summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/snac.82
-rw-r--r--html.c30
-rw-r--r--utils.c1
3 files changed, 23 insertions, 10 deletions
diff --git a/doc/snac.8 b/doc/snac.8
index e228495..e9b33dd 100644
--- a/doc/snac.8
+++ b/doc/snac.8
@@ -205,6 +205,8 @@ The email address of the instance administrator (optional).
205The user name of the instance administrator (optional). 205The user name of the instance administrator (optional).
206.It Ic short_description 206.It Ic short_description
207A textual short description about the instance (optional). 207A textual short description about the instance (optional).
208.It Ic short_description_raw
209Whether to interpret short_descript as raw string or convert to HTML (optional).
208.It Ic fastcgi 210.It Ic fastcgi
209If set to true, 211If set to true,
210.Nm 212.Nm
diff --git a/html.c b/html.c
index 500272b..5f1cd6c 100644
--- a/html.c
+++ b/html.c
@@ -553,10 +553,11 @@ xs_html *html_instance_head(void)
553 553
554static xs_html *html_instance_body(void) 554static xs_html *html_instance_body(void)
555{ 555{
556 const char *host = xs_dict_get(srv_config, "host"); 556 const char *host = xs_dict_get(srv_config, "host");
557 const char *sdesc = xs_dict_get(srv_config, "short_description"); 557 const char *sdesc = xs_dict_get(srv_config, "short_description");
558 const char *email = xs_dict_get(srv_config, "admin_email"); 558 const char *sdescraw = xs_dict_get(srv_config, "short_description_raw");
559 const char *acct = xs_dict_get(srv_config, "admin_account"); 559 const char *email = xs_dict_get(srv_config, "admin_email");
560 const char *acct = xs_dict_get(srv_config, "admin_account");
560 561
561 xs *blurb = xs_replace(snac_blurb, "%host%", host); 562 xs *blurb = xs_replace(snac_blurb, "%host%", host);
562 563
@@ -569,12 +570,21 @@ static xs_html *html_instance_body(void)
569 dl = xs_html_tag("dl", NULL))); 570 dl = xs_html_tag("dl", NULL)));
570 571
571 if (sdesc && *sdesc) { 572 if (sdesc && *sdesc) {
572 xs_html_add(dl, 573 if (!xs_is_null(sdescraw) && xs_type(sdescraw) == XSTYPE_TRUE) {
573 xs_html_tag("di", 574 xs_html_add(dl,
574 xs_html_tag("dt", 575 xs_html_tag("di",
575 xs_html_text(L("Site description"))), 576 xs_html_tag("dt",
576 xs_html_tag("dd", 577 xs_html_text(L("Site description"))),
577 xs_html_text(sdesc)))); 578 xs_html_tag("dd",
579 xs_html_raw(sdesc))));
580 } else {
581 xs_html_add(dl,
582 xs_html_tag("di",
583 xs_html_tag("dt",
584 xs_html_text(L("Site description"))),
585 xs_html_tag("dd",
586 xs_html_text(sdesc))));
587 }
578 } 588 }
579 if (email && *email) { 589 if (email && *email) {
580 xs *mailto = xs_fmt("mailto:%s", email); 590 xs *mailto = xs_fmt("mailto:%s", email);
diff --git a/utils.c b/utils.c
index 946897f..ae1c1b6 100644
--- a/utils.c
+++ b/utils.c
@@ -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 "}";