summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-11-27 14:15:36 +0100
committerdefault <nobody@localhost>2023-11-27 14:15:36 +0100
commitc50e6c41ea04c14604b87a5698156afb30cb3b94 (patch)
tree793b3a7ef53d7348e058c54ceb39a7ad11d458bf
parent3ac738b0b96dc36ed1c7a91eddf4b6c44e6f89d2 (diff)
New function html_instance_head().
-rw-r--r--html.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/html.c b/html.c
index a399bd1..aec8afc 100644
--- a/html.c
+++ b/html.c
@@ -427,7 +427,7 @@ static xs_html *html_base_head(void)
}
-xs_str *html_instance_header(xs_str *s, char *tag)
+xs_html *html_instance_head(void)
{
xs_html *head = html_base_head();
@@ -447,14 +447,24 @@ xs_str *html_instance_header(xs_str *s, char *tag)
char *host = xs_dict_get(srv_config, "host");
char *title = xs_dict_get(srv_config, "title");
- char *sdesc = xs_dict_get(srv_config, "short_description");
- char *email = xs_dict_get(srv_config, "admin_email");
- char *acct = xs_dict_get(srv_config, "admin_account");
xs_html_add(head,
xs_html_tag("title",
xs_html_text(title && *title ? title : host)));
+ return head;
+}
+
+
+xs_str *html_instance_header(xs_str *s, char *tag)
+{
+ xs_html *head = html_instance_head();
+
+ char *host = xs_dict_get(srv_config, "host");
+ char *sdesc = xs_dict_get(srv_config, "short_description");
+ char *email = xs_dict_get(srv_config, "admin_email");
+ char *acct = xs_dict_get(srv_config, "admin_account");
+
{
xs *s1 = xs_html_render(head);
s = xs_str_cat(s, "<!DOCTYPE html><html>\n", s1);