diff options
| author | 2025-02-05 09:34:27 +0000 | |
|---|---|---|
| committer | 2025-02-05 09:34:27 +0000 | |
| commit | 43812a3721b8917eea7c0bbe6d3636d4d74923bc (patch) | |
| tree | 2dd47adeb1de3755cc3724ceb885cad5027fd26f /html.c | |
| parent | Updated RELEASE_NOTES. (diff) | |
| parent | Merge branch 'master' into master (diff) | |
| download | penes-snac2-43812a3721b8917eea7c0bbe6d3636d4d74923bc.tar.gz penes-snac2-43812a3721b8917eea7c0bbe6d3636d4d74923bc.tar.xz penes-snac2-43812a3721b8917eea7c0bbe6d3636d4d74923bc.zip | |
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.c | 30 |
1 files changed, 20 insertions, 10 deletions
| @@ -553,10 +553,11 @@ xs_html *html_instance_head(void) | |||
| 553 | 553 | ||
| 554 | static xs_html *html_instance_body(void) | 554 | static 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); |