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>
Šī revīzija ir iekļauta:
Lars Hjemli 2008-07-19 20:40:30 +02:00
vecāks de5e928171
revīzija 502865a5ec
4 mainīti faili ar 10 papildinājumiem un 0 dzēšanām

2
cgit.c
Parādīt failu

@ -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"))

1
cgit.h
Parādīt failu

@ -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;

2
cgitrc
Parādīt failu

@ -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

Parādīt failu

@ -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");
}