diff options
author | Mark Lodato | 2009-03-15 00:11:54 -0400 |
---|---|---|
committer | Lars Hjemli | 2009-06-07 18:55:44 +0200 |
commit | b5a3a2049648415e86d518a8bf2229b3e463b10f (patch) | |
tree | 37c44671e4557d38ba3d5905f0b595376aece5d6 | |
parent | Merge branch 'stable' (diff) | |
download | cgit-b5a3a2049648415e86d518a8bf2229b3e463b10f.tar.gz cgit-b5a3a2049648415e86d518a8bf2229b3e463b10f.zip |
Add head-include configuration option.
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.
-rw-r--r-- | cgit.c | 2 | ||||
-rw-r--r-- | cgit.h | 1 | ||||
-rw-r--r-- | ui-shared.c | 4 |
3 files changed, 6 insertions, 1 deletions
diff --git a/cgit.c b/cgit.c index 64d95f9..2afc598 100644 --- a/cgit.c +++ b/cgit.c | |||
@@ -31,6 +31,8 @@ void config_cb(const char *name, const char *value) | |||
31 | ctx.cfg.favicon = xstrdup(value); | 31 | ctx.cfg.favicon = xstrdup(value); |
32 | else if (!strcmp(name, "footer")) | 32 | else if (!strcmp(name, "footer")) |
33 | ctx.cfg.footer = xstrdup(value); | 33 | ctx.cfg.footer = xstrdup(value); |
34 | else if (!strcmp(name, "head-include")) | ||
35 | ctx.cfg.head_include = xstrdup(value); | ||
34 | else if (!strcmp(name, "header")) | 36 | else if (!strcmp(name, "header")) |
35 | ctx.cfg.header = xstrdup(value); | 37 | ctx.cfg.header = xstrdup(value); |
36 | else if (!strcmp(name, "logo")) | 38 | else if (!strcmp(name, "logo")) |
diff --git a/cgit.h b/cgit.h index 5f7af51..aed826a 100644 --- a/cgit.h +++ b/cgit.h | |||
@@ -136,6 +136,7 @@ struct cgit_config { | |||
136 | char *css; | 136 | char *css; |
137 | char *favicon; | 137 | char *favicon; |
138 | char *footer; | 138 | char *footer; |
139 | char *head_include; | ||
139 | char *header; | 140 | char *header; |
140 | char *index_header; | 141 | char *index_header; |
141 | char *index_info; | 142 | char *index_info; |
diff --git a/ui-shared.c b/ui-shared.c index de77bbf..fea2c40 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -496,8 +496,10 @@ void cgit_print_docstart(struct cgit_context *ctx) | |||
496 | html_attr(cgit_hosturl()); | 496 | html_attr(cgit_hosturl()); |
497 | html_attr(cgit_fileurl(ctx->repo->url, "atom", ctx->qry.path, | 497 | html_attr(cgit_fileurl(ctx->repo->url, "atom", ctx->qry.path, |
498 | fmt("h=%s", ctx->qry.head))); | 498 | fmt("h=%s", ctx->qry.head))); |
499 | html("' type='application/atom+xml'/>"); | 499 | html("' type='application/atom+xml'/>\n"); |
500 | } | 500 | } |
501 | if (ctx->cfg.head_include) | ||
502 | html_include(ctx->cfg.head_include); | ||
501 | html("</head>\n"); | 503 | html("</head>\n"); |
502 | html("<body>\n"); | 504 | html("<body>\n"); |
503 | if (ctx->cfg.header) | 505 | if (ctx->cfg.header) |