aboutsummaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorgrunfink <grunfink@noreply.codeberg.org>2025-02-05 09:34:27 +0000
committergrunfink <grunfink@noreply.codeberg.org>2025-02-05 09:34:27 +0000
commit43812a3721b8917eea7c0bbe6d3636d4d74923bc (patch)
tree2dd47adeb1de3755cc3724ceb885cad5027fd26f /html.c
parent4842abbfc679495efb5984bfc712ce9d812ed1b5 (diff)
parent114ed37f9c3e57a840155b9b71fa9cdf0d7ec8d6 (diff)
Merge pull request 'Add short_description_raw option' (#266) from ltning/snac2:master into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/266
Diffstat (limited to 'html.c')
-rw-r--r--html.c30
1 files changed, 20 insertions, 10 deletions
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)
static xs_html *html_instance_body(void)
{
- const char *host = xs_dict_get(srv_config, "host");
- const char *sdesc = xs_dict_get(srv_config, "short_description");
- const char *email = xs_dict_get(srv_config, "admin_email");
- const char *acct = xs_dict_get(srv_config, "admin_account");
+ const char *host = xs_dict_get(srv_config, "host");
+ const char *sdesc = xs_dict_get(srv_config, "short_description");
+ const char *sdescraw = xs_dict_get(srv_config, "short_description_raw");
+ const char *email = xs_dict_get(srv_config, "admin_email");
+ const char *acct = xs_dict_get(srv_config, "admin_account");
xs *blurb = xs_replace(snac_blurb, "%host%", host);
@@ -569,12 +570,21 @@ static xs_html *html_instance_body(void)
dl = xs_html_tag("dl", NULL)));
if (sdesc && *sdesc) {
- xs_html_add(dl,
- xs_html_tag("di",
- xs_html_tag("dt",
- xs_html_text(L("Site description"))),
- xs_html_tag("dd",
- xs_html_text(sdesc))));
+ if (!xs_is_null(sdescraw) && xs_type(sdescraw) == XSTYPE_TRUE) {
+ xs_html_add(dl,
+ xs_html_tag("di",
+ xs_html_tag("dt",
+ xs_html_text(L("Site description"))),
+ xs_html_tag("dd",
+ xs_html_raw(sdesc))));
+ } else {
+ xs_html_add(dl,
+ xs_html_tag("di",
+ xs_html_tag("dt",
+ xs_html_text(L("Site description"))),
+ xs_html_tag("dd",
+ xs_html_text(sdesc))));
+ }
}
if (email && *email) {
xs *mailto = xs_fmt("mailto:%s", email);