summaryrefslogtreecommitdiffabout
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
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 (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.c2
-rw-r--r--cgit.h1
-rw-r--r--cgitrc2
-rw-r--r--ui-shared.c5
4 files changed, 10 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index 8f154c9..8795085 100644
--- a/cgit.c
+++ b/cgit.c
@@ -27,2 +27,4 @@ void config_cb(const char *name, const char *value)
ctx.cfg.css = xstrdup(value);
+ else if (!strcmp(name, "favicon"))
+ ctx.cfg.favicon = xstrdup(value);
else if (!strcmp(name, "footer"))
diff --git a/cgit.h b/cgit.h
index d18d9ca..7881aca 100644
--- a/cgit.h
+++ b/cgit.h
@@ -127,2 +127,3 @@ struct cgit_config {
char *css;
+ char *favicon;
char *footer;
diff --git a/cgitrc b/cgitrc
index f1d8997..9e8a0f2 100644
--- a/cgitrc
+++ b/cgitrc
@@ -109,2 +109,4 @@
+## Link to favicon
+#favicon=/favicon.ico
diff --git a/ui-shared.c b/ui-shared.c
index 8a00099..6f83d2a 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -439,2 +439,7 @@ void cgit_print_docstart(struct cgit_context *ctx)
html("'/>\n");
+ if (ctx->cfg.favicon) {
+ html("<link rel='shortcut icon' href='");
+ html_attr(ctx->cfg.favicon);
+ html("'/>\n");
+ }
html("</head>\n");