else if (!strcmp(name, "root-readme"))
ctx.cfg.root_readme = xstrdup(value);
else if (!strcmp(name, "css"))
- ctx.cfg.css = xstrdup(value);
+ string_list_append(&ctx.cfg.css, xstrdup(value));
else if (!strcmp(name, "favicon"))
ctx.cfg.favicon = xstrdup(value);
else if (!strcmp(name, "footer"))
ctx.cfg.case_sensitive_sort = 1;
ctx.cfg.branch_sort = 0;
ctx.cfg.commit_sort = 0;
- ctx.cfg.css = "/cgit.css";
ctx.cfg.logo = "/cgit.png";
ctx.cfg.favicon = "/favicon.ico";
ctx.cfg.local_time = 0;
char *cache_root;
char *clone_prefix;
char *clone_url;
- char *css;
char *favicon;
char *footer;
char *head_include;
char *module_link;
char *project_list;
struct string_list readme;
+ struct string_list css;
char *robots;
char *root_title;
char *root_desc;
css::
Url which specifies the css document to include in all cgit pages.
- Default value: "/cgit.css".
+ Default value: "/cgit.css". May be given multiple times, each
+ css URL path is added in the head section of the document in turn.
email-filter::
Specifies a command which will be invoked to format names and email
html(" Git repository'/>\n");
}
+static int emit_css_link(struct string_list_item *s, void *arg)
+{
+ html("<link rel='stylesheet' type='text/css' href='");
+ if (s)
+ html_attr(s->string);
+ else
+ html_attr((const char *)arg);
+ html("'/>\n");
+
+ return 0;
+}
+
void cgit_print_docstart(void)
{
char *host = cgit_hosturl();
htmlf("<meta name='generator' content='cgit %s'/>\n", cgit_version);
if (ctx.cfg.robots && *ctx.cfg.robots)
htmlf("<meta name='robots' content='%s'/>\n", ctx.cfg.robots);
- html("<link rel='stylesheet' type='text/css' href='");
- html_attr(ctx.cfg.css);
- html("'/>\n");
+
+ if (ctx.cfg.css.items)
+ for_each_string_list(&ctx.cfg.css, emit_css_link, NULL);
+ else
+ emit_css_link(NULL, "/cgit.css");
+
if (ctx.cfg.favicon) {
html("<link rel='shortcut icon' href='");
html_attr(ctx.cfg.favicon);