From 502865a5ec40fed5f1f865cb34002aecaab8405e Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Sat, 19 Jul 2008 20:40:30 +0200 Subject: Add a favicon option to cgitrc This option is used to specify a shortcut icon on all cgit pages. Signed-off-by: Lars Hjemli --- cgit.c | 2 ++ cgit.h | 1 + cgitrc | 2 ++ ui-shared.c | 5 +++++ 4 files changed, 10 insertions(+) diff --git a/cgit.c b/cgit.c index 8f154c9..8795085 100644 --- a/cgit.c +++ b/cgit.c @@ -25,6 +25,8 @@ void config_cb(const char *name, const char *value) 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")) diff --git a/cgit.h b/cgit.h index d18d9ca..7881aca 100644 --- a/cgit.h +++ b/cgit.h @@ -125,6 +125,7 @@ struct cgit_config { char *cache_root; char *clone_prefix; char *css; + char *favicon; char *footer; char *index_header; char *index_info; diff --git a/cgitrc b/cgitrc index f1d8997..9e8a0f2 100644 --- a/cgitrc +++ b/cgitrc @@ -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 diff --git a/ui-shared.c b/ui-shared.c index 8a00099..6f83d2a 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -437,6 +437,11 @@ void cgit_print_docstart(struct cgit_context *ctx) html("\n"); + if (ctx->cfg.favicon) { + html("\n"); + } html("\n"); html("\n"); } -- cgit v1.2.3-57-g22cb