config: add js
Just like the config allows setting css URL path,
add a config for setting the js URL path
Setting the js path to an empty string disables
emitting the reference to it in the head section.
Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: John Keeping <john@keeping.me.uk>
diff --git a/cgit.c b/cgit.c
index bdb2fad..8b23c8f 100644
--- a/cgit.c
+++ b/cgit.c
@@ -146,6 +146,8 @@
ctx.cfg.root_readme = xstrdup(value);
else if (!strcmp(name, "css"))
ctx.cfg.css = xstrdup(value);
+ else if (!strcmp(name, "js"))
+ ctx.cfg.js = xstrdup(value);
else if (!strcmp(name, "favicon"))
ctx.cfg.favicon = xstrdup(value);
else if (!strcmp(name, "footer"))
@@ -384,6 +386,7 @@
ctx.cfg.branch_sort = 0;
ctx.cfg.commit_sort = 0;
ctx.cfg.css = "/cgit.css";
+ ctx.cfg.js = "/cgit.js";
ctx.cfg.logo = "/cgit.png";
ctx.cfg.favicon = "/favicon.ico";
ctx.cfg.local_time = 0;