about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--cgit.c2
-rw-r--r--cgit.h1
-rw-r--r--ui-shared.c4
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)
 		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 5f7af51..aed826a 100644
--- 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;
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)
 		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)
better things to sort by but title definitely always exists. 2021-09-13Swap-remove tags as they're foundJune McEnroe This makes it even faster. From ~1s on a sqlite3.c amalgamation to ~0.85s. 2021-09-12Replace htagml regex with strncmpJune McEnroe Since ctags only ever produces regular expressions of the form /^re$/ or /^re/ with no other special characters, instead unescape the pattern and simply use strncmp. Running on a sqlite3.c amalgamation, the regex version takes ~37s while the strncmp version takes ~1s, producing identical output. Big win! 2021-09-11Also defer printing comment for lone close-parensJune McEnroe 2021-09-10Publish "git-comment"June McEnroe 2021-09-10Add git comment --pretty optionJune McEnroe 2021-09-08Defer printing comment if line is blank or closing braceJune McEnroe This fixes badly indented comments. 2021-09-08Up default min-repeat to 30 linesJune McEnroe 2021-09-08Handle dirty lines in git-commentJune McEnroe 2021-09-08Document and install git-commentJune McEnroe 2021-09-08Add repeat and all options to git-commentJune McEnroe 2021-09-08Add group threshold to git-commentJune McEnroe