summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--cgit.c2
-rw-r--r--cgit.h1
-rw-r--r--cgitrc.5.txt4
-rw-r--r--ui-shared.c2
4 files changed, 9 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index 608cab6..64d95f9 100644
--- a/cgit.c
+++ b/cgit.c
@@ -22,24 +22,26 @@ void config_cb(const char *name, const char *value)
if (!strcmp(name, "root-title"))
ctx.cfg.root_title = xstrdup(value);
else if (!strcmp(name, "root-desc"))
ctx.cfg.root_desc = xstrdup(value);
else if (!strcmp(name, "root-readme"))
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, "header"))
+ ctx.cfg.header = xstrdup(value);
else if (!strcmp(name, "logo"))
ctx.cfg.logo = xstrdup(value);
else if (!strcmp(name, "index-header"))
ctx.cfg.index_header = xstrdup(value);
else if (!strcmp(name, "index-info"))
ctx.cfg.index_info = xstrdup(value);
else if (!strcmp(name, "logo-link"))
ctx.cfg.logo_link = xstrdup(value);
else if (!strcmp(name, "module-link"))
ctx.cfg.module_link = xstrdup(value);
else if (!strcmp(name, "virtual-root")) {
ctx.cfg.virtual_root = trim_end(value, '/');
diff --git a/cgit.h b/cgit.h
index 4fe94c6..4942b96 100644
--- a/cgit.h
+++ b/cgit.h
@@ -126,24 +126,25 @@ struct cgit_query {
int nohead;
char *sort;
int showmsg;
};
struct cgit_config {
char *agefile;
char *cache_root;
char *clone_prefix;
char *css;
char *favicon;
char *footer;
+ char *header;
char *index_header;
char *index_info;
char *logo;
char *logo_link;
char *module_link;
char *repo_group;
char *robots;
char *root_title;
char *root_desc;
char *root_readme;
char *script_name;
char *virtual_root;
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index 09f56a6..fd299ae 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -75,24 +75,28 @@ enable-log-linecount
value: "0".
favicon
Url used as link to a shortcut icon for cgit. If specified, it is
suggested to use the value "/favicon.ico" since certain browsers will
ignore other values. Default value: none.
footer
The content of the file specified with this option will be included
verbatim at the bottom of all pages (i.e. it replaces the standard
"generated by..." message. Default value: none.
+header
+ The content of the file specified with this option will be included
+ verbatim at the top of all pages. Default value: none.
+
include
Name of a configfile to include before the rest of the current config-
file is parsed. Default value: none.
index-header
The content of the file specified with this option will be included
verbatim above the repository index. This setting is deprecated, and
will not be supported by cgit-1.0 (use root-readme instead). Default
value: none.
index-info
The content of the file specified with this option will be included
diff --git a/ui-shared.c b/ui-shared.c
index 4f28512..de77bbf 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -491,24 +491,26 @@ void cgit_print_docstart(struct cgit_context *ctx)
html_attr(ctx->cfg.favicon);
html("'/>\n");
}
if (host && ctx->repo) {
html("<link rel='alternate' title='Atom feed' href='http://");
html_attr(cgit_hosturl());
html_attr(cgit_fileurl(ctx->repo->url, "atom", ctx->qry.path,
fmt("h=%s", ctx->qry.head)));
html("' type='application/atom+xml'/>");
}
html("</head>\n");
html("<body>\n");
+ if (ctx->cfg.header)
+ html_include(ctx->cfg.header);
}
void cgit_print_docend()
{
html("</div>");
if (ctx.cfg.footer)
html_include(ctx.cfg.footer);
else {
htmlf("<div class='footer'>generated by cgit %s at ",
cgit_version);
cgit_print_date(time(NULL), FMT_LONGDATE, ctx.cfg.local_time);
html("</div>\n");