cgit

commit b115955d71c50cd2d0065c45f3df6b02fa4730bd

Author: Lars Hjemli <hjemli@gmail.com>

Add support for a custom header

Signed-off-by: Lars Hjemli <hjemli@gmail.com>

 cgit.c | 2 ++
 cgit.h | 1 +
 cgitrc.5.txt | 4 ++++
 ui-shared.c | 2 ++


diff --git a/cgit.c b/cgit.c
index 608cab658425e5c11270ac3d1690a842eec71891..64d95f9a3a7bb56197988e6730c4576173811db0 100644
--- a/cgit.c
+++ b/cgit.c
@@ -31,6 +31,8 @@ 	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"))




diff --git a/cgit.h b/cgit.h
index 4fe94c69e6939d969572a6c1b4601d5267f390c2..4942b96277e56752cb227cbda954a20892e1288b 100644
--- a/cgit.h
+++ b/cgit.h
@@ -135,6 +135,7 @@ 	char *clone_prefix;
 	char *css;
 	char *favicon;
 	char *footer;
+	char *header;
 	char *index_header;
 	char *index_info;
 	char *logo;




diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index 09f56a68366f015818a18d0f1ec92202d509582a..fd299ae091e422c17f925fb695ae3111a3045fcd 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -84,6 +84,10 @@ 	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.




diff --git a/ui-shared.c b/ui-shared.c
index 4f2851273418dc9a81c4af942660e4923a149f5e..de77bbfadf86dd08e794145395ca1e20e1f63e9c 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -500,6 +500,8 @@ 		html("' type='application/atom+xml'/>");
 	}
 	html("</head>\n");
 	html("<body>\n");
+	if (ctx->cfg.header)
+		html_include(ctx->cfg.header);
 }
 
 void cgit_print_docend()