summaryrefslogtreecommitdiffabout
authorLars Hjemli <hjemli@gmail.com>2009-01-29 20:27:39 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2009-01-29 20:27:39 (UTC)
commitb115955d71c50cd2d0065c45f3df6b02fa4730bd (patch) (side-by-side diff)
tree074182f3e305b4982a97c482ed5fbcc5c6d270a7
parenta61871a18ffa9fc28e7ab0950415404350c8c857 (diff)
downloadcgit-b115955d71c50cd2d0065c45f3df6b02fa4730bd.zip
cgit-b115955d71c50cd2d0065c45f3df6b02fa4730bd.tar.gz
cgit-b115955d71c50cd2d0065c45f3df6b02fa4730bd.tar.bz2
Add support for a custom header
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--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
@@ -28,12 +28,14 @@ void config_cb(const char *name, const char *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);
diff --git a/cgit.h b/cgit.h
index 4fe94c6..4942b96 100644
--- a/cgit.h
+++ b/cgit.h
@@ -132,12 +132,13 @@ 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;
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index 09f56a6..fd299ae 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -81,12 +81,16 @@ favicon
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
diff --git a/ui-shared.c b/ui-shared.c
index 4f28512..de77bbf 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -497,12 +497,14 @@ void cgit_print_docstart(struct cgit_context *ctx)
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)