summaryrefslogtreecommitdiffabout
path: root/ui-shared.c
authorMark Lodato <lodatom@gmail.com>2009-03-15 04:11:54 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2009-06-07 16:55:44 (UTC)
commitb5a3a2049648415e86d518a8bf2229b3e463b10f (patch) (side-by-side diff)
tree37c44671e4557d38ba3d5905f0b595376aece5d6 /ui-shared.c
parent45e7fcecc1117440e6274ce3c6ab7d893c4986ee (diff)
downloadcgit-b5a3a2049648415e86d518a8bf2229b3e463b10f.zip
cgit-b5a3a2049648415e86d518a8bf2229b3e463b10f.tar.gz
cgit-b5a3a2049648415e86d518a8bf2229b3e463b10f.tar.bz2
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.
Diffstat (limited to 'ui-shared.c') (more/less context) (show whitespace changes)
-rw-r--r--ui-shared.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui-shared.c b/ui-shared.c
index de77bbf..fea2c40 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -475,50 +475,52 @@ void cgit_print_docstart(struct cgit_context *ctx)
{
char *host = cgit_hosturl();
html(cgit_doctype);
html("<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>\n");
html("<head>\n");
html("<title>");
html_txt(ctx->page.title);
html("</title>\n");
htmlf("<meta name='generator' content='cgit %s'/>\n", cgit_version);
if (ctx->cfg.robots && *ctx->cfg.robots)
htmlf("<meta name='robots' content='%s'/>\n", ctx->cfg.robots);
html("<link rel='stylesheet' type='text/css' href='");
html_attr(ctx->cfg.css);
html("'/>\n");
if (ctx->cfg.favicon) {
html("<link rel='shortcut icon' href='");
html_attr(ctx->cfg.favicon);
html("'/>\n");
}
if (host && ctx->repo) {
html("<link rel='alternate' title='Atom feed' href='http://");
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)
html_include(ctx->cfg.header);
}
void cgit_print_docend()
{
html("</div>");
if (ctx.cfg.footer)
html_include(ctx.cfg.footer);
else {
htmlf("<div class='footer'>generated by cgit %s at ",
cgit_version);
cgit_print_date(time(NULL), FMT_LONGDATE, ctx.cfg.local_time);
html("</div>\n");
}
html("</body>\n</html>\n");
}
int print_branch_option(const char *refname, const unsigned char *sha1,
int flags, void *cb_data)
{
char *name = (char *)refname;