diff options
author | Lars Hjemli | 2008-07-19 20:40:30 +0200 |
---|---|---|
committer | Lars Hjemli | 2008-07-19 20:47:39 +0200 |
commit | 502865a5ec40fed5f1f865cb34002aecaab8405e (patch) | |
tree | ab53ab68d6c56948502287ff3cdad45c409aebbb | |
parent | de5e9281719809c5b07051faa88e95bd16e8d485 (diff) | |
download | cgit-502865a5ec40fed5f1f865cb34002aecaab8405e.tar.gz cgit-502865a5ec40fed5f1f865cb34002aecaab8405e.tar.bz2 cgit-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.c | 2 | ||||
-rw-r--r-- | cgit.h | 1 | ||||
-rw-r--r-- | cgitrc | 2 | ||||
-rw-r--r-- | ui-shared.c | 5 |
4 files changed, 10 insertions, 0 deletions
@@ -25,6 +25,8 @@ void config_cb(const char *name, const char *value) | |||
25 | ctx.cfg.root_readme = xstrdup(value); | 25 | ctx.cfg.root_readme = xstrdup(value); |
26 | else if (!strcmp(name, "css")) | 26 | else if (!strcmp(name, "css")) |
27 | ctx.cfg.css = xstrdup(value); | 27 | ctx.cfg.css = xstrdup(value); |
28 | else if (!strcmp(name, "favicon")) | ||
29 | ctx.cfg.favicon = xstrdup(value); | ||
28 | else if (!strcmp(name, "footer")) | 30 | else if (!strcmp(name, "footer")) |
29 | ctx.cfg.footer = xstrdup(value); | 31 | ctx.cfg.footer = xstrdup(value); |
30 | else if (!strcmp(name, "logo")) | 32 | else if (!strcmp(name, "logo")) |
@@ -125,6 +125,7 @@ struct cgit_config { | |||
125 | char *cache_root; | 125 | char *cache_root; |
126 | char *clone_prefix; | 126 | char *clone_prefix; |
127 | char *css; | 127 | char *css; |
128 | char *favicon; | ||
128 | char *footer; | 129 | char *footer; |
129 | char *index_header; | 130 | char *index_header; |
130 | char *index_info; | 131 | char *index_info; |
@@ -107,6 +107,8 @@ | |||
107 | ## Link to css file | 107 | ## Link to css file |
108 | #css=/cgit/cgit.css | 108 | #css=/cgit/cgit.css |
109 | 109 | ||
110 | ## Link to favicon | ||
111 | #favicon=/favicon.ico | ||
110 | 112 | ||
111 | ## Link to logo file | 113 | ## Link to logo file |
112 | #logo=/cgit/git-logo.png | 114 | #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) | |||
437 | html("<link rel='stylesheet' type='text/css' href='"); | 437 | html("<link rel='stylesheet' type='text/css' href='"); |
438 | html_attr(ctx->cfg.css); | 438 | html_attr(ctx->cfg.css); |
439 | html("'/>\n"); | 439 | html("'/>\n"); |
440 | if (ctx->cfg.favicon) { | ||
441 | html("<link rel='shortcut icon' href='"); | ||
442 | html_attr(ctx->cfg.favicon); | ||
443 | html("'/>\n"); | ||
444 | } | ||
440 | html("</head>\n"); | 445 | html("</head>\n"); |
441 | html("<body>\n"); | 446 | html("<body>\n"); |
442 | } | 447 | } |