]> granicus.if.org Git - cgit/commitdiff
Add support for a custom header
authorLars Hjemli <hjemli@gmail.com>
Thu, 29 Jan 2009 20:27:39 +0000 (21:27 +0100)
committerLars Hjemli <hjemli@gmail.com>
Thu, 29 Jan 2009 20:27:39 +0000 (21:27 +0100)
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
cgit.c
cgit.h
cgitrc.5.txt
ui-shared.c

diff --git a/cgit.c b/cgit.c
index 608cab658425e5c11270ac3d1690a842eec71891..64d95f9a3a7bb56197988e6730c4576173811db0 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -31,6 +31,8 @@ void config_cb(const char *name, const char *value)
                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 (file)
--- a/cgit.h
+++ b/cgit.h
@@ -135,6 +135,7 @@ struct cgit_config {
        char *css;
        char *favicon;
        char *footer;
+       char *header;
        char *index_header;
        char *index_info;
        char *logo;
index 09f56a68366f015818a18d0f1ec92202d509582a..fd299ae091e422c17f925fb695ae3111a3045fcd 100644 (file)
@@ -84,6 +84,10 @@ footer
        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 4f2851273418dc9a81c4af942660e4923a149f5e..de77bbfadf86dd08e794145395ca1e20e1f63e9c 100644 (file)
@@ -500,6 +500,8 @@ void cgit_print_docstart(struct cgit_context *ctx)
        }
        html("</head>\n");
        html("<body>\n");
+       if (ctx->cfg.header)
+               html_include(ctx->cfg.header);
 }
 
 void cgit_print_docend()