]> granicus.if.org Git - cgit/commitdiff
Add a favicon option to cgitrc
authorLars Hjemli <larsh@hatman.(none)>
Sat, 19 Jul 2008 18:40:30 +0000 (20:40 +0200)
committerLars Hjemli <larsh@hatman.(none)>
Sat, 19 Jul 2008 18:47:39 +0000 (20:47 +0200)
This option is used to specify a shortcut icon on all cgit pages.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
cgit.c
cgit.h
cgitrc
ui-shared.c

diff --git a/cgit.c b/cgit.c
index 8f154c96fbc793a0c170793fc8a8949ec1887de2..87950858a267f61433486fc32c9adbb8dda6e29a 100644 (file)
--- 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 d18d9ca52eb103365aae44901d1983598737bd98..7881acaf065902a392bc1b513fb4d87a4aabec88 100644 (file)
--- 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 f1d8997090daa903db1c09fd371ce496e5cf457a..9e8a0f2ff5de2b61c5211eaad48479c37c556368 100644 (file)
--- a/cgitrc
+++ b/cgitrc
 ## Link to css file
 #css=/cgit/cgit.css
 
+## Link to favicon
+#favicon=/favicon.ico
 
 ## Link to logo file
 #logo=/cgit/git-logo.png
index 8a00099fdf10bc9871742c6eb561ab450c83a2b6..6f83d2a772208c794eee360da531ae73d9913acb 100644 (file)
@@ -437,6 +437,11 @@ void cgit_print_docstart(struct cgit_context *ctx)
        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");
 }