about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLars Hjemli <larsh@hatman.(none)>2008-07-19 20:40:30 +0200
committerLars Hjemli <larsh@hatman.(none)>2008-07-19 20:47:39 +0200
commit502865a5ec40fed5f1f865cb34002aecaab8405e (patch)
treeab53ab68d6c56948502287ff3cdad45c409aebbb
parentAdd support for including a footer on all pages (diff)
downloadcgit-pink-502865a5ec40fed5f1f865cb34002aecaab8405e.tar.gz
cgit-pink-502865a5ec40fed5f1f865cb34002aecaab8405e.zip
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>
-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
@@ -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("<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");
 }
70a372386a587174c37ff4558b335b0cbf18&follow=1'>Add psf2pngJune McEnroe 2018-09-27Add HJKL for moving glyphs to psfedJune McEnroe 2018-09-27Move psfed paste to edit modeJune McEnroe 2018-09-27Export PWDJune McEnroe Without it, $(PWD) is unset in GNU make. 2018-09-27Add sans6x8 PSF2 fontJune McEnroe 2018-09-26Add copy paste to psfedJune McEnroe 2018-09-25Add r to psfed for invertJune McEnroe 2018-09-24Add psfed, a PSF2 font editorJune McEnroe 2018-09-21Add scheme -i to swap white and blackJune McEnroe 2018-09-21Map caps lock to escape on Linux consoleJune McEnroe 2018-09-19Fix README mandoc lintsJune McEnroe 2018-09-19Un-NOT trans.alpha values in pngoJune McEnroe 2018-09-18Refactor reads in pngo and clear palette between filesJune McEnroe 2018-09-17Add tRNS support to pngoJune McEnroe 2018-09-11Move gfx man pages to gfx/manJune McEnroe 2018-09-11Move bin man pages to bin/manJune McEnroe 2018-09-11Rewrite gfx.7 and render plaintext READMEJune McEnroe 2018-09-11Remove GAMES from BINSJune McEnroe 2018-09-11Rewrite bin.7 and render to plaintext READMEJune McEnroe 2018-09-11Add "blank" lines to man pagesJune McEnroe 2018-09-10Add mdoc syntax fileJune McEnroe 2018-09-08Fix Nm usage in multi-name man pagesJune McEnroe 2018-09-08Put real dates on man pagesJune McEnroe 2018-09-08Replace gfx README with REAMDE.7June McEnroe 2018-09-08Link gfx man pages in ~/.localJune McEnroe