diff options
| -rw-r--r-- | doc/snac.8 | 2 | ||||
| -rw-r--r-- | html.c | 30 | ||||
| -rw-r--r-- | utils.c | 1 |
3 files changed, 23 insertions, 10 deletions
| @@ -205,6 +205,8 @@ The email address of the instance administrator (optional). | |||
| 205 | The user name of the instance administrator (optional). | 205 | The user name of the instance administrator (optional). |
| 206 | .It Ic short_description | 206 | .It Ic short_description |
| 207 | A textual short description about the instance (optional). | 207 | A textual short description about the instance (optional). |
| 208 | .It Ic short_description_raw | ||
| 209 | Whether to interpret short_descript as raw string or convert to HTML (optional) | ||
| 208 | .It Ic fastcgi | 210 | .It Ic fastcgi |
| 209 | If set to true, | 211 | If set to true, |
| 210 | .Nm | 212 | .Nm |
| @@ -537,10 +537,11 @@ xs_html *html_instance_head(void) | |||
| 537 | 537 | ||
| 538 | static xs_html *html_instance_body(void) | 538 | static xs_html *html_instance_body(void) |
| 539 | { | 539 | { |
| 540 | const char *host = xs_dict_get(srv_config, "host"); | 540 | const char *host = xs_dict_get(srv_config, "host"); |
| 541 | const char *sdesc = xs_dict_get(srv_config, "short_description"); | 541 | const char *sdesc = xs_dict_get(srv_config, "short_description"); |
| 542 | const char *email = xs_dict_get(srv_config, "admin_email"); | 542 | const char *sdescraw = xs_dict_get(srv_config, "short_description_raw"); |
| 543 | const char *acct = xs_dict_get(srv_config, "admin_account"); | 543 | const char *email = xs_dict_get(srv_config, "admin_email"); |
| 544 | const char *acct = xs_dict_get(srv_config, "admin_account"); | ||
| 544 | 545 | ||
| 545 | xs *blurb = xs_replace(snac_blurb, "%host%", host); | 546 | xs *blurb = xs_replace(snac_blurb, "%host%", host); |
| 546 | 547 | ||
| @@ -553,12 +554,21 @@ static xs_html *html_instance_body(void) | |||
| 553 | dl = xs_html_tag("dl", NULL))); | 554 | dl = xs_html_tag("dl", NULL))); |
| 554 | 555 | ||
| 555 | if (sdesc && *sdesc) { | 556 | if (sdesc && *sdesc) { |
| 556 | xs_html_add(dl, | 557 | if (!xs_is_null(sdescraw) && xs_type(sdescraw) == XSTYPE_TRUE) { |
| 557 | xs_html_tag("di", | 558 | xs_html_add(dl, |
| 558 | xs_html_tag("dt", | 559 | xs_html_tag("di", |
| 559 | xs_html_text(L("Site description"))), | 560 | xs_html_tag("dt", |
| 560 | xs_html_tag("dd", | 561 | xs_html_text(L("Site description"))), |
| 561 | xs_html_text(sdesc)))); | 562 | xs_html_tag("dd", |
| 563 | xs_html_raw(sdesc)))); | ||
| 564 | } else { | ||
| 565 | xs_html_add(dl, | ||
| 566 | xs_html_tag("di", | ||
| 567 | xs_html_tag("dt", | ||
| 568 | xs_html_text(L("Site description"))), | ||
| 569 | xs_html_tag("dd", | ||
| 570 | xs_html_text(sdesc)))); | ||
| 571 | } | ||
| 562 | } | 572 | } |
| 563 | if (email && *email) { | 573 | if (email && *email) { |
| 564 | xs *mailto = xs_fmt("mailto:%s", email); | 574 | xs *mailto = xs_fmt("mailto:%s", email); |
| @@ -36,6 +36,7 @@ static const char *default_srv_config = "{" | |||
| 36 | "\"admin_account\": \"\"," | 36 | "\"admin_account\": \"\"," |
| 37 | "\"title\": \"\"," | 37 | "\"title\": \"\"," |
| 38 | "\"short_description\": \"\"," | 38 | "\"short_description\": \"\"," |
| 39 | "\"short_description_raw\": false," | ||
| 39 | "\"protocol\": \"https\"," | 40 | "\"protocol\": \"https\"," |
| 40 | "\"fastcgi\": false" | 41 | "\"fastcgi\": false" |
| 41 | "}"; | 42 | "}"; |