commit c50e6c41ea04c14604b87a5698156afb30cb3b94
parent 3ac738b0b96dc36ed1c7a91eddf4b6c44e6f89d2
Author: default <nobody@localhost>
Date: Mon, 27 Nov 2023 14:15:36 +0100
New function html_instance_head().
Diffstat:
M | html.c | | | 18 | ++++++++++++++---- |
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git 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);