]> granicus.if.org Git - cgit/commitdiff
Add head-include configuration option.
authorMark Lodato <lodatom@gmail.com>
Sun, 15 Mar 2009 04:11:54 +0000 (00:11 -0400)
committerLars Hjemli <hjemli@gmail.com>
Sun, 7 Jun 2009 16:55:44 +0000 (18:55 +0200)
This patch adds an option to the configuration file, "head-include",
which works just like "header" or "footer", except the content is put
into the HTML's <head> tag.

cgit.c
cgit.h
ui-shared.c

diff --git a/cgit.c b/cgit.c
index 64d95f9a3a7bb56197988e6730c4576173811db0..2afc5988afa1261b3adacfd4d8c307838766c1cb 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, "head-include"))
+               ctx.cfg.head_include = xstrdup(value);
        else if (!strcmp(name, "header"))
                ctx.cfg.header = xstrdup(value);
        else if (!strcmp(name, "logo"))
diff --git a/cgit.h b/cgit.h
index 5f7af51a68e0a773cac9c2758df51d5f0af90ff6..aed826afe589484ac60b7184460741c899eecbf7 100644 (file)
--- a/cgit.h
+++ b/cgit.h
@@ -136,6 +136,7 @@ struct cgit_config {
        char *css;
        char *favicon;
        char *footer;
+       char *head_include;
        char *header;
        char *index_header;
        char *index_info;
index de77bbfadf86dd08e794145395ca1e20e1f63e9c..fea2c4054c736b53bf97f7dc735016e94663f0c4 100644 (file)
@@ -496,8 +496,10 @@ void cgit_print_docstart(struct cgit_context *ctx)
                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("' type='application/atom+xml'/>\n");
        }
+       if (ctx->cfg.head_include)
+               html_include(ctx->cfg.head_include);
        html("</head>\n");
        html("<body>\n");
        if (ctx->cfg.header)