mirror of
https://git.zx2c4.com/cgit
synced 2024-11-22 16:38:42 +00:00
Teach cgit howto include an external file on index page.
The new parameter index-header can be used to name an external file which will be included verbatim at the top of the index page. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
This commit is contained in:
parent
5e75128a8b
commit
de69ce020c
1
cgit.h
1
cgit.h
@ -75,6 +75,7 @@ extern struct repoinfo *cgit_repo;
|
||||
extern char *cgit_root_title;
|
||||
extern char *cgit_css;
|
||||
extern char *cgit_logo;
|
||||
extern char *cgit_index_header;
|
||||
extern char *cgit_logo_link;
|
||||
extern char *cgit_module_link;
|
||||
extern char *cgit_virtual_root;
|
||||
|
3
shared.c
3
shared.c
@ -14,6 +14,7 @@ struct repoinfo *cgit_repo;
|
||||
char *cgit_root_title = "Git repository browser";
|
||||
char *cgit_css = "/cgit.css";
|
||||
char *cgit_logo = "/git-logo.png";
|
||||
char *cgit_index_header = NULL;
|
||||
char *cgit_logo_link = "http://www.kernel.org/pub/software/scm/git/docs/";
|
||||
char *cgit_module_link = "./?repo=%s&page=commit&id=%s";
|
||||
char *cgit_virtual_root = NULL;
|
||||
@ -101,6 +102,8 @@ void cgit_global_config_cb(const char *name, const char *value)
|
||||
cgit_css = xstrdup(value);
|
||||
else if (!strcmp(name, "logo"))
|
||||
cgit_logo = xstrdup(value);
|
||||
else if (!strcmp(name, "index-header"))
|
||||
cgit_index_header = xstrdup(value);
|
||||
else if (!strcmp(name, "logo-link"))
|
||||
cgit_logo_link = xstrdup(value);
|
||||
else if (!strcmp(name, "module-link"))
|
||||
|
@ -17,6 +17,11 @@ void cgit_print_repolist(struct cacheitem *item)
|
||||
cgit_print_pageheader(cgit_root_title, 0);
|
||||
|
||||
html("<table class='list nowrap'>");
|
||||
if (cgit_index_header) {
|
||||
html("<tr class='nohover'><td colspan='4' class='include-block'>");
|
||||
html_include(cgit_index_header);
|
||||
html("</td></tr>");
|
||||
}
|
||||
html("<tr class='nohover'>"
|
||||
"<th class='left'>Name</th>"
|
||||
"<th class='left'>Description</th>"
|
||||
|
Loading…
Reference in New Issue
Block a user