aboutsummaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorgrunfink <grunfink@comam.es>2025-06-18 09:40:10 +0200
committergrunfink <grunfink@comam.es>2025-06-18 09:40:10 +0200
commit0e30411f5890bfbe578a196a54ad46b72e3e49d7 (patch)
tree6bcf92051fc3def01260765730fb2a2c21f1487a /html.c
parent9b134e9076569b31eb5ec77ebda60eb9001485a8 (diff)
New field 'favicon_url' in server.json.
Diffstat (limited to 'html.c')
-rw-r--r--html.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/html.c b/html.c
index b4588f7..c472e3b 100644
--- a/html.c
+++ b/html.c
@@ -636,13 +636,18 @@ static xs_html *html_base_head(void)
xs_html_attr("content", USER_AGENT)));
/* add server CSS and favicon */
- xs *f;
- f = xs_fmt("%s/favicon.ico", srv_baseurl);
+ xs *f = NULL;
+ const char *favicon = xs_dict_get(srv_config, "favicon_url");
+
+ if (xs_is_string(favicon))
+ f = xs_dup(favicon);
+ else
+ f = xs_fmt("%s/favicon.ico", srv_baseurl);
+
const xs_list *p = xs_dict_get(srv_config, "cssurls");
const char *v;
- int c = 0;
- while (xs_list_next(p, &v, &c)) {
+ xs_list_foreach(p, v) {
xs_html_add(head,
xs_html_sctag("link",
xs_html_attr("rel", "stylesheet"),