author | Mark Lodato <lodatom@gmail.com> | 2009-03-15 04:11:54 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2009-06-07 16:55:44 (UTC) |
commit | b5a3a2049648415e86d518a8bf2229b3e463b10f (patch) (unidiff) | |
tree | 37c44671e4557d38ba3d5905f0b595376aece5d6 /cgit.c | |
parent | 45e7fcecc1117440e6274ce3c6ab7d893c4986ee (diff) | |
download | cgit-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.
-rw-r--r-- | cgit.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -10,48 +10,50 @@ | |||
10 | #include "cache.h" | 10 | #include "cache.h" |
11 | #include "cmd.h" | 11 | #include "cmd.h" |
12 | #include "configfile.h" | 12 | #include "configfile.h" |
13 | #include "html.h" | 13 | #include "html.h" |
14 | #include "ui-shared.h" | 14 | #include "ui-shared.h" |
15 | #include "ui-stats.h" | 15 | #include "ui-stats.h" |
16 | #include "scan-tree.h" | 16 | #include "scan-tree.h" |
17 | 17 | ||
18 | const char *cgit_version = CGIT_VERSION; | 18 | const char *cgit_version = CGIT_VERSION; |
19 | 19 | ||
20 | void config_cb(const char *name, const char *value) | 20 | void config_cb(const char *name, const char *value) |
21 | { | 21 | { |
22 | if (!strcmp(name, "root-title")) | 22 | if (!strcmp(name, "root-title")) |
23 | ctx.cfg.root_title = xstrdup(value); | 23 | ctx.cfg.root_title = xstrdup(value); |
24 | else if (!strcmp(name, "root-desc")) | 24 | else if (!strcmp(name, "root-desc")) |
25 | ctx.cfg.root_desc = xstrdup(value); | 25 | ctx.cfg.root_desc = xstrdup(value); |
26 | else if (!strcmp(name, "root-readme")) | 26 | else if (!strcmp(name, "root-readme")) |
27 | ctx.cfg.root_readme = xstrdup(value); | 27 | ctx.cfg.root_readme = xstrdup(value); |
28 | else if (!strcmp(name, "css")) | 28 | else if (!strcmp(name, "css")) |
29 | ctx.cfg.css = xstrdup(value); | 29 | ctx.cfg.css = xstrdup(value); |
30 | else if (!strcmp(name, "favicon")) | 30 | else if (!strcmp(name, "favicon")) |
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")) |
37 | ctx.cfg.logo = xstrdup(value); | 39 | ctx.cfg.logo = xstrdup(value); |
38 | else if (!strcmp(name, "index-header")) | 40 | else if (!strcmp(name, "index-header")) |
39 | ctx.cfg.index_header = xstrdup(value); | 41 | ctx.cfg.index_header = xstrdup(value); |
40 | else if (!strcmp(name, "index-info")) | 42 | else if (!strcmp(name, "index-info")) |
41 | ctx.cfg.index_info = xstrdup(value); | 43 | ctx.cfg.index_info = xstrdup(value); |
42 | else if (!strcmp(name, "logo-link")) | 44 | else if (!strcmp(name, "logo-link")) |
43 | ctx.cfg.logo_link = xstrdup(value); | 45 | ctx.cfg.logo_link = xstrdup(value); |
44 | else if (!strcmp(name, "module-link")) | 46 | else if (!strcmp(name, "module-link")) |
45 | ctx.cfg.module_link = xstrdup(value); | 47 | ctx.cfg.module_link = xstrdup(value); |
46 | else if (!strcmp(name, "virtual-root")) { | 48 | else if (!strcmp(name, "virtual-root")) { |
47 | ctx.cfg.virtual_root = trim_end(value, '/'); | 49 | ctx.cfg.virtual_root = trim_end(value, '/'); |
48 | if (!ctx.cfg.virtual_root && (!strcmp(value, "/"))) | 50 | if (!ctx.cfg.virtual_root && (!strcmp(value, "/"))) |
49 | ctx.cfg.virtual_root = ""; | 51 | ctx.cfg.virtual_root = ""; |
50 | } else if (!strcmp(name, "nocache")) | 52 | } else if (!strcmp(name, "nocache")) |
51 | ctx.cfg.nocache = atoi(value); | 53 | ctx.cfg.nocache = atoi(value); |
52 | else if (!strcmp(name, "snapshots")) | 54 | else if (!strcmp(name, "snapshots")) |
53 | ctx.cfg.snapshots = cgit_parse_snapshots_mask(value); | 55 | ctx.cfg.snapshots = cgit_parse_snapshots_mask(value); |
54 | else if (!strcmp(name, "enable-index-links")) | 56 | else if (!strcmp(name, "enable-index-links")) |
55 | ctx.cfg.enable_index_links = atoi(value); | 57 | ctx.cfg.enable_index_links = atoi(value); |
56 | else if (!strcmp(name, "enable-log-filecount")) | 58 | else if (!strcmp(name, "enable-log-filecount")) |
57 | ctx.cfg.enable_log_filecount = atoi(value); | 59 | ctx.cfg.enable_log_filecount = atoi(value); |