mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-10 03:50:38 +03:00
feature(favicon): Add favicon support (#107)
This commit is contained in:
parent
d5c2c442b1
commit
fe892622d3
9
html.c
9
html.c
@ -427,7 +427,9 @@ static xs_html *html_base_head(void)
|
|||||||
xs_html_attr("name", "generator"),
|
xs_html_attr("name", "generator"),
|
||||||
xs_html_attr("content", USER_AGENT)));
|
xs_html_attr("content", USER_AGENT)));
|
||||||
|
|
||||||
/* add server CSS */
|
/* add server CSS and favicon */
|
||||||
|
xs *f;
|
||||||
|
f = xs_fmt("%s/favicon.ico", srv_baseurl);
|
||||||
xs_list *p = xs_dict_get(srv_config, "cssurls");
|
xs_list *p = xs_dict_get(srv_config, "cssurls");
|
||||||
char *v;
|
char *v;
|
||||||
while (xs_list_iter(&p, &v)) {
|
while (xs_list_iter(&p, &v)) {
|
||||||
@ -436,6 +438,11 @@ static xs_html *html_base_head(void)
|
|||||||
xs_html_attr("rel", "stylesheet"),
|
xs_html_attr("rel", "stylesheet"),
|
||||||
xs_html_attr("type", "text/css"),
|
xs_html_attr("type", "text/css"),
|
||||||
xs_html_attr("href", v)));
|
xs_html_attr("href", v)));
|
||||||
|
xs_html_add(head,
|
||||||
|
xs_html_sctag("link",
|
||||||
|
xs_html_attr("rel", "icon"),
|
||||||
|
xs_html_attr("type", "image/x-icon"),
|
||||||
|
xs_html_attr("href", f)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return head;
|
return head;
|
||||||
|
1
utils.c
1
utils.c
@ -81,6 +81,7 @@ static const char *greeting_html =
|
|||||||
"<!DOCTYPE html>\n"
|
"<!DOCTYPE html>\n"
|
||||||
"<html><head>\n"
|
"<html><head>\n"
|
||||||
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n"
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n"
|
||||||
|
"<link rel=\"icon\" type=\"image/x-icon\" href=\"https://%host%/favicon.ico\"/>\n"
|
||||||
"<title>Welcome to %host%</title>\n"
|
"<title>Welcome to %host%</title>\n"
|
||||||
"<body style=\"margin: auto; max-width: 50em\">\n"
|
"<body style=\"margin: auto; max-width: 50em\">\n"
|
||||||
"%blurb%"
|
"%blurb%"
|
||||||
|
Loading…
Reference in New Issue
Block a user