all repos — cgit @ 502865a5ec40fed5f1f865cb34002aecaab8405e

a hyperfast web frontend for git written in c

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>
Lars Hjemli larsh@hatman.(none)
Sat, 19 Jul 2008 20:40:30 +0200
commit

502865a5ec40fed5f1f865cb34002aecaab8405e

parent

de5e9281719809c5b07051faa88e95bd16e8d485

4 files changed, 10 insertions(+), 0 deletions(-)

jump to
M cgit.ccgit.c

@@ -25,6 +25,8 @@ else if (!strcmp(name, "root-readme"))

ctx.cfg.root_readme = xstrdup(value); else if (!strcmp(name, "css")) ctx.cfg.css = xstrdup(value); + else if (!strcmp(name, "favicon")) + ctx.cfg.favicon = xstrdup(value); else if (!strcmp(name, "footer")) ctx.cfg.footer = xstrdup(value); else if (!strcmp(name, "logo"))
M cgit.hcgit.h

@@ -125,6 +125,7 @@ char *agefile;

char *cache_root; char *clone_prefix; char *css; + char *favicon; char *footer; char *index_header; char *index_info;
M cgitrccgitrc

@@ -107,6 +107,8 @@

## Link to css file #css=/cgit/cgit.css +## Link to favicon +#favicon=/favicon.ico ## Link to logo file #logo=/cgit/git-logo.png
M ui-shared.cui-shared.c

@@ -437,6 +437,11 @@ 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"); }