author | Lars Hjemli <hjemli@gmail.com> | 2009-01-29 20:27:39 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2009-01-29 20:27:39 (UTC) |
commit | b115955d71c50cd2d0065c45f3df6b02fa4730bd (patch) (unidiff) | |
tree | 074182f3e305b4982a97c482ed5fbcc5c6d270a7 /cgit.c | |
parent | a61871a18ffa9fc28e7ab0950415404350c8c857 (diff) | |
download | cgit-b115955d71c50cd2d0065c45f3df6b02fa4730bd.zip cgit-b115955d71c50cd2d0065c45f3df6b02fa4730bd.tar.gz cgit-b115955d71c50cd2d0065c45f3df6b02fa4730bd.tar.bz2 |
Add support for a custom header
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-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, "header")) | ||
35 | ctx.cfg.header = xstrdup(value); | ||
34 | else if (!strcmp(name, "logo")) | 36 | else if (!strcmp(name, "logo")) |
35 | ctx.cfg.logo = xstrdup(value); | 37 | ctx.cfg.logo = xstrdup(value); |
36 | else if (!strcmp(name, "index-header")) | 38 | else if (!strcmp(name, "index-header")) |
37 | ctx.cfg.index_header = xstrdup(value); | 39 | ctx.cfg.index_header = xstrdup(value); |
38 | else if (!strcmp(name, "index-info")) | 40 | else if (!strcmp(name, "index-info")) |
39 | ctx.cfg.index_info = xstrdup(value); | 41 | ctx.cfg.index_info = xstrdup(value); |
40 | else if (!strcmp(name, "logo-link")) | 42 | else if (!strcmp(name, "logo-link")) |
41 | ctx.cfg.logo_link = xstrdup(value); | 43 | ctx.cfg.logo_link = xstrdup(value); |
42 | else if (!strcmp(name, "module-link")) | 44 | else if (!strcmp(name, "module-link")) |
43 | ctx.cfg.module_link = xstrdup(value); | 45 | ctx.cfg.module_link = xstrdup(value); |
44 | else if (!strcmp(name, "virtual-root")) { | 46 | else if (!strcmp(name, "virtual-root")) { |
45 | ctx.cfg.virtual_root = trim_end(value, '/'); | 47 | ctx.cfg.virtual_root = trim_end(value, '/'); |
46 | if (!ctx.cfg.virtual_root && (!strcmp(value, "/"))) | 48 | if (!ctx.cfg.virtual_root && (!strcmp(value, "/"))) |
47 | ctx.cfg.virtual_root = ""; | 49 | ctx.cfg.virtual_root = ""; |
48 | } else if (!strcmp(name, "nocache")) | 50 | } else if (!strcmp(name, "nocache")) |
49 | ctx.cfg.nocache = atoi(value); | 51 | ctx.cfg.nocache = atoi(value); |
50 | else if (!strcmp(name, "snapshots")) | 52 | else if (!strcmp(name, "snapshots")) |
51 | ctx.cfg.snapshots = cgit_parse_snapshots_mask(value); | 53 | ctx.cfg.snapshots = cgit_parse_snapshots_mask(value); |
52 | else if (!strcmp(name, "enable-index-links")) | 54 | else if (!strcmp(name, "enable-index-links")) |
53 | ctx.cfg.enable_index_links = atoi(value); | 55 | ctx.cfg.enable_index_links = atoi(value); |
54 | else if (!strcmp(name, "enable-log-filecount")) | 56 | else if (!strcmp(name, "enable-log-filecount")) |
55 | ctx.cfg.enable_log_filecount = atoi(value); | 57 | ctx.cfg.enable_log_filecount = atoi(value); |
56 | else if (!strcmp(name, "enable-log-linecount")) | 58 | else if (!strcmp(name, "enable-log-linecount")) |
57 | ctx.cfg.enable_log_linecount = atoi(value); | 59 | ctx.cfg.enable_log_linecount = atoi(value); |