summaryrefslogtreecommitdiffabout
path: root/ui-shared.c
authorLars Hjemli <larsh@hatman.(none)>2008-07-19 18:40:30 (UTC)
committer Lars Hjemli <larsh@hatman.(none)>2008-07-19 18:47:39 (UTC)
commit502865a5ec40fed5f1f865cb34002aecaab8405e (patch) (side-by-side diff)
treeab53ab68d6c56948502287ff3cdad45c409aebbb /ui-shared.c
parentde5e9281719809c5b07051faa88e95bd16e8d485 (diff)
downloadcgit-502865a5ec40fed5f1f865cb34002aecaab8405e.zip
cgit-502865a5ec40fed5f1f865cb34002aecaab8405e.tar.gz
cgit-502865a5ec40fed5f1f865cb34002aecaab8405e.tar.bz2
Add a favicon option to cgitrc
This option is used to specify a shortcut icon on all cgit pages. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-shared.c') (more/less context) (show whitespace changes)
-rw-r--r--ui-shared.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 8a00099..6f83d2a 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -424,32 +424,37 @@ void cgit_print_http_headers(struct cgit_context *ctx)
}
void cgit_print_docstart(struct cgit_context *ctx)
{
html(cgit_doctype);
html("<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>\n");
html("<head>\n");
html("<title>");
html_txt(ctx->page.title);
html("</title>\n");
htmlf("<meta name='generator' content='cgit %s'/>\n", cgit_version);
if (ctx->cfg.robots && *ctx->cfg.robots)
htmlf("<meta name='robots' content='%s'/>\n", ctx->cfg.robots);
html("<link rel='stylesheet' type='text/css' href='");
html_attr(ctx->cfg.css);
html("'/>\n");
+ if (ctx->cfg.favicon) {
+ html("<link rel='shortcut icon' href='");
+ html_attr(ctx->cfg.favicon);
+ html("'/>\n");
+ }
html("</head>\n");
html("<body>\n");
}
void cgit_print_docend()
{
html("</div>");
if (ctx.cfg.footer)
html_include(ctx.cfg.footer);
else {
html("<div class='footer'>generated ");
cgit_print_date(time(NULL), FMT_LONGDATE);
htmlf(" by cgit %s", cgit_version);
html("</div>\n");
}
html("</body>\n</html>\n");