summaryrefslogtreecommitdiffabout
authorLars Hjemli <hjemli@gmail.com>2009-02-01 18:17:52 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2009-02-01 18:17:52 (UTC)
commit0b3c746ba80738dbe0885a21406409390936537c (patch) (unidiff)
tree405a9f959feafab650f53e17561a1d3a85cb8097
parentd6174b7aab476c2b6a86e59d98cf978d603045f4 (diff)
parentb115955d71c50cd2d0065c45f3df6b02fa4730bd (diff)
downloadcgit-0b3c746ba80738dbe0885a21406409390936537c.zip
cgit-0b3c746ba80738dbe0885a21406409390936537c.tar.gz
cgit-0b3c746ba80738dbe0885a21406409390936537c.tar.bz2
Merge branch 'lh/header'
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.c2
-rw-r--r--cgit.h1
-rw-r--r--cgitrc.5.txt4
-rw-r--r--ui-shared.c2
4 files changed, 9 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index 608cab6..64d95f9 100644
--- a/cgit.c
+++ b/cgit.c
@@ -18,32 +18,34 @@
18const char *cgit_version = CGIT_VERSION; 18const char *cgit_version = CGIT_VERSION;
19 19
20void config_cb(const char *name, const char *value) 20void 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);
diff --git a/cgit.h b/cgit.h
index 4fe94c6..4942b96 100644
--- a/cgit.h
+++ b/cgit.h
@@ -122,32 +122,33 @@ struct cgit_query {
122 char *mimetype; 122 char *mimetype;
123 char *url; 123 char *url;
124 char *period; 124 char *period;
125 int ofs; 125 int ofs;
126 int nohead; 126 int nohead;
127 char *sort; 127 char *sort;
128 int showmsg; 128 int showmsg;
129}; 129};
130 130
131struct cgit_config { 131struct cgit_config {
132 char *agefile; 132 char *agefile;
133 char *cache_root; 133 char *cache_root;
134 char *clone_prefix; 134 char *clone_prefix;
135 char *css; 135 char *css;
136 char *favicon; 136 char *favicon;
137 char *footer; 137 char *footer;
138 char *header;
138 char *index_header; 139 char *index_header;
139 char *index_info; 140 char *index_info;
140 char *logo; 141 char *logo;
141 char *logo_link; 142 char *logo_link;
142 char *module_link; 143 char *module_link;
143 char *repo_group; 144 char *repo_group;
144 char *robots; 145 char *robots;
145 char *root_title; 146 char *root_title;
146 char *root_desc; 147 char *root_desc;
147 char *root_readme; 148 char *root_readme;
148 char *script_name; 149 char *script_name;
149 char *virtual_root; 150 char *virtual_root;
150 int cache_size; 151 int cache_size;
151 int cache_dynamic_ttl; 152 int cache_dynamic_ttl;
152 int cache_max_create_time; 153 int cache_max_create_time;
153 int cache_repo_ttl; 154 int cache_repo_ttl;
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index 09f56a6..fd299ae 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -71,32 +71,36 @@ enable-log-filecount
71 71
72enable-log-linecount 72enable-log-linecount
73 Flag which, when set to "1", will make cgit print the number of added 73 Flag which, when set to "1", will make cgit print the number of added
74 and removed lines for each commit on the repository log page. Default 74 and removed lines for each commit on the repository log page. Default
75 value: "0". 75 value: "0".
76 76
77favicon 77favicon
78 Url used as link to a shortcut icon for cgit. If specified, it is 78 Url used as link to a shortcut icon for cgit. If specified, it is
79 suggested to use the value "/favicon.ico" since certain browsers will 79 suggested to use the value "/favicon.ico" since certain browsers will
80 ignore other values. Default value: none. 80 ignore other values. Default value: none.
81 81
82footer 82footer
83 The content of the file specified with this option will be included 83 The content of the file specified with this option will be included
84 verbatim at the bottom of all pages (i.e. it replaces the standard 84 verbatim at the bottom of all pages (i.e. it replaces the standard
85 "generated by..." message. Default value: none. 85 "generated by..." message. Default value: none.
86 86
87header
88 The content of the file specified with this option will be included
89 verbatim at the top of all pages. Default value: none.
90
87include 91include
88 Name of a configfile to include before the rest of the current config- 92 Name of a configfile to include before the rest of the current config-
89 file is parsed. Default value: none. 93 file is parsed. Default value: none.
90 94
91index-header 95index-header
92 The content of the file specified with this option will be included 96 The content of the file specified with this option will be included
93 verbatim above the repository index. This setting is deprecated, and 97 verbatim above the repository index. This setting is deprecated, and
94 will not be supported by cgit-1.0 (use root-readme instead). Default 98 will not be supported by cgit-1.0 (use root-readme instead). Default
95 value: none. 99 value: none.
96 100
97index-info 101index-info
98 The content of the file specified with this option will be included 102 The content of the file specified with this option will be included
99 verbatim below the heading on the repository index page. This setting 103 verbatim below the heading on the repository index page. This setting
100 is deprecated, and will not be supported by cgit-1.0 (use root-desc 104 is deprecated, and will not be supported by cgit-1.0 (use root-desc
101 instead). Default value: none. 105 instead). Default value: none.
102 106
diff --git a/ui-shared.c b/ui-shared.c
index 4f28512..de77bbf 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -487,32 +487,34 @@ void cgit_print_docstart(struct cgit_context *ctx)
487 html_attr(ctx->cfg.css); 487 html_attr(ctx->cfg.css);
488 html("'/>\n"); 488 html("'/>\n");
489 if (ctx->cfg.favicon) { 489 if (ctx->cfg.favicon) {
490 html("<link rel='shortcut icon' href='"); 490 html("<link rel='shortcut icon' href='");
491 html_attr(ctx->cfg.favicon); 491 html_attr(ctx->cfg.favicon);
492 html("'/>\n"); 492 html("'/>\n");
493 } 493 }
494 if (host && ctx->repo) { 494 if (host && ctx->repo) {
495 html("<link rel='alternate' title='Atom feed' href='http://"); 495 html("<link rel='alternate' title='Atom feed' href='http://");
496 html_attr(cgit_hosturl()); 496 html_attr(cgit_hosturl());
497 html_attr(cgit_fileurl(ctx->repo->url, "atom", ctx->qry.path, 497 html_attr(cgit_fileurl(ctx->repo->url, "atom", ctx->qry.path,
498 fmt("h=%s", ctx->qry.head))); 498 fmt("h=%s", ctx->qry.head)));
499 html("' type='application/atom+xml'/>"); 499 html("' type='application/atom+xml'/>");
500 } 500 }
501 html("</head>\n"); 501 html("</head>\n");
502 html("<body>\n"); 502 html("<body>\n");
503 if (ctx->cfg.header)
504 html_include(ctx->cfg.header);
503} 505}
504 506
505void cgit_print_docend() 507void cgit_print_docend()
506{ 508{
507 html("</div>"); 509 html("</div>");
508 if (ctx.cfg.footer) 510 if (ctx.cfg.footer)
509 html_include(ctx.cfg.footer); 511 html_include(ctx.cfg.footer);
510 else { 512 else {
511 htmlf("<div class='footer'>generated by cgit %s at ", 513 htmlf("<div class='footer'>generated by cgit %s at ",
512 cgit_version); 514 cgit_version);
513 cgit_print_date(time(NULL), FMT_LONGDATE, ctx.cfg.local_time); 515 cgit_print_date(time(NULL), FMT_LONGDATE, ctx.cfg.local_time);
514 html("</div>\n"); 516 html("</div>\n");
515 } 517 }
516 html("</body>\n</html>\n"); 518 html("</body>\n</html>\n");
517} 519}
518 520