diff options
| -rw-r--r-- | html.c | 10 | ||||
| -rw-r--r-- | utils.c | 1 |
2 files changed, 10 insertions, 1 deletions
| @@ -427,7 +427,9 @@ static xs_html *html_base_head(void) | |||
| 427 | xs_html_attr("name", "generator"), | 427 | xs_html_attr("name", "generator"), |
| 428 | xs_html_attr("content", USER_AGENT))); | 428 | xs_html_attr("content", USER_AGENT))); |
| 429 | 429 | ||
| 430 | /* add server CSS */ | 430 | /* add server CSS and favicon */ |
| 431 | xs *f; | ||
| 432 | f = xs_fmt("%s/favicon.ico", srv_baseurl); | ||
| 431 | xs_list *p = xs_dict_get(srv_config, "cssurls"); | 433 | xs_list *p = xs_dict_get(srv_config, "cssurls"); |
| 432 | char *v; | 434 | char *v; |
| 433 | while (xs_list_iter(&p, &v)) { | 435 | while (xs_list_iter(&p, &v)) { |
| @@ -438,6 +440,12 @@ static xs_html *html_base_head(void) | |||
| 438 | xs_html_attr("href", v))); | 440 | xs_html_attr("href", v))); |
| 439 | } | 441 | } |
| 440 | 442 | ||
| 443 | xs_html_add(head, | ||
| 444 | xs_html_sctag("link", | ||
| 445 | xs_html_attr("rel", "icon"), | ||
| 446 | xs_html_attr("type", "image/x-icon"), | ||
| 447 | xs_html_attr("href", f))); | ||
| 448 | |||
| 441 | return head; | 449 | return head; |
| 442 | } | 450 | } |
| 443 | 451 | ||
| @@ -81,6 +81,7 @@ static const char *greeting_html = | |||
| 81 | "<!DOCTYPE html>\n" | 81 | "<!DOCTYPE html>\n" |
| 82 | "<html><head>\n" | 82 | "<html><head>\n" |
| 83 | "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n" | 83 | "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n" |
| 84 | "<link rel=\"icon\" type=\"image/x-icon\" href=\"https://%host%/favicon.ico\"/>\n" | ||
| 84 | "<title>Welcome to %host%</title>\n" | 85 | "<title>Welcome to %host%</title>\n" |
| 85 | "<body style=\"margin: auto; max-width: 50em\">\n" | 86 | "<body style=\"margin: auto; max-width: 50em\">\n" |
| 86 | "%blurb%" | 87 | "%blurb%" |