diff options
| author | 2023-11-27 14:15:36 +0100 | |
|---|---|---|
| committer | 2023-11-27 14:15:36 +0100 | |
| commit | c50e6c41ea04c14604b87a5698156afb30cb3b94 (patch) | |
| tree | 793b3a7ef53d7348e058c54ceb39a7ad11d458bf /html.c | |
| parent | More HTML tweaks. (diff) | |
| download | snac2-c50e6c41ea04c14604b87a5698156afb30cb3b94.tar.gz snac2-c50e6c41ea04c14604b87a5698156afb30cb3b94.tar.xz snac2-c50e6c41ea04c14604b87a5698156afb30cb3b94.zip | |
New function html_instance_head().
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 18 |
1 files changed, 14 insertions, 4 deletions
| @@ -427,7 +427,7 @@ static xs_html *html_base_head(void) | |||
| 427 | } | 427 | } |
| 428 | 428 | ||
| 429 | 429 | ||
| 430 | xs_str *html_instance_header(xs_str *s, char *tag) | 430 | xs_html *html_instance_head(void) |
| 431 | { | 431 | { |
| 432 | xs_html *head = html_base_head(); | 432 | xs_html *head = html_base_head(); |
| 433 | 433 | ||
| @@ -447,14 +447,24 @@ xs_str *html_instance_header(xs_str *s, char *tag) | |||
| 447 | 447 | ||
| 448 | char *host = xs_dict_get(srv_config, "host"); | 448 | char *host = xs_dict_get(srv_config, "host"); |
| 449 | char *title = xs_dict_get(srv_config, "title"); | 449 | char *title = xs_dict_get(srv_config, "title"); |
| 450 | char *sdesc = xs_dict_get(srv_config, "short_description"); | ||
| 451 | char *email = xs_dict_get(srv_config, "admin_email"); | ||
| 452 | char *acct = xs_dict_get(srv_config, "admin_account"); | ||
| 453 | 450 | ||
| 454 | xs_html_add(head, | 451 | xs_html_add(head, |
| 455 | xs_html_tag("title", | 452 | xs_html_tag("title", |
| 456 | xs_html_text(title && *title ? title : host))); | 453 | xs_html_text(title && *title ? title : host))); |
| 457 | 454 | ||
| 455 | return head; | ||
| 456 | } | ||
| 457 | |||
| 458 | |||
| 459 | xs_str *html_instance_header(xs_str *s, char *tag) | ||
| 460 | { | ||
| 461 | xs_html *head = html_instance_head(); | ||
| 462 | |||
| 463 | char *host = xs_dict_get(srv_config, "host"); | ||
| 464 | char *sdesc = xs_dict_get(srv_config, "short_description"); | ||
| 465 | char *email = xs_dict_get(srv_config, "admin_email"); | ||
| 466 | char *acct = xs_dict_get(srv_config, "admin_account"); | ||
| 467 | |||
| 458 | { | 468 | { |
| 459 | xs *s1 = xs_html_render(head); | 469 | xs *s1 = xs_html_render(head); |
| 460 | s = xs_str_cat(s, "<!DOCTYPE html><html>\n", s1); | 470 | s = xs_str_cat(s, "<!DOCTYPE html><html>\n", s1); |