diff options
| author | 2024-01-27 18:35:21 +0100 | |
|---|---|---|
| committer | 2024-01-28 08:09:44 +0100 | |
| commit | fe892622d33e45dd110abb8e6251b672ae1181d0 (patch) | |
| tree | 0834b0ff130bda2fa0e1c1f433d9a475d4b1a439 | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | penes-snac2-fe892622d33e45dd110abb8e6251b672ae1181d0.tar.gz penes-snac2-fe892622d33e45dd110abb8e6251b672ae1181d0.tar.xz penes-snac2-fe892622d33e45dd110abb8e6251b672ae1181d0.zip | |
feature(favicon): Add favicon support (#107)
Diffstat (limited to '')
| -rw-r--r-- | html.c | 9 | ||||
| -rw-r--r-- | utils.c | 1 |
2 files changed, 9 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)) { |
| @@ -436,6 +438,11 @@ static xs_html *html_base_head(void) | |||
| 436 | xs_html_attr("rel", "stylesheet"), | 438 | xs_html_attr("rel", "stylesheet"), |
| 437 | xs_html_attr("type", "text/css"), | 439 | xs_html_attr("type", "text/css"), |
| 438 | xs_html_attr("href", v))); | 440 | xs_html_attr("href", v))); |
| 441 | xs_html_add(head, | ||
| 442 | xs_html_sctag("link", | ||
| 443 | xs_html_attr("rel", "icon"), | ||
| 444 | xs_html_attr("type", "image/x-icon"), | ||
| 445 | xs_html_attr("href", f))); | ||
| 439 | } | 446 | } |
| 440 | 447 | ||
| 441 | return head; | 448 | return head; |
| @@ -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%" |