diff options
Diffstat (limited to 'ui-shared.c')
| -rw-r--r-- | ui-shared.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/ui-shared.c b/ui-shared.c index 3afa15e..1251c9a 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
| @@ -768,6 +768,18 @@ static void print_rel_vcs_link(const char *url) | |||
| 768 | html(" Git repository'/>\n"); | 768 | html(" Git repository'/>\n"); |
| 769 | } | 769 | } |
| 770 | 770 | ||
| 771 | static int emit_css_link(struct string_list_item *s, void *arg) | ||
| 772 | { | ||
| 773 | html("<link rel='stylesheet' type='text/css' href='"); | ||
| 774 | if (s) | ||
| 775 | html_attr(s->string); | ||
| 776 | else | ||
| 777 | html_attr((const char *)arg); | ||
| 778 | html("'/>\n"); | ||
| 779 | |||
| 780 | return 0; | ||
| 781 | } | ||
| 782 | |||
| 771 | void cgit_print_docstart(void) | 783 | void cgit_print_docstart(void) |
| 772 | { | 784 | { |
| 773 | char *host = cgit_hosturl(); | 785 | char *host = cgit_hosturl(); |
| @@ -787,9 +799,12 @@ void cgit_print_docstart(void) | |||
| 787 | htmlf("<meta name='generator' content='cgit %s'/>\n", cgit_version); | 799 | htmlf("<meta name='generator' content='cgit %s'/>\n", cgit_version); |
| 788 | if (ctx.cfg.robots && *ctx.cfg.robots) | 800 | if (ctx.cfg.robots && *ctx.cfg.robots) |
| 789 | htmlf("<meta name='robots' content='%s'/>\n", ctx.cfg.robots); | 801 | htmlf("<meta name='robots' content='%s'/>\n", ctx.cfg.robots); |
| 790 | html("<link rel='stylesheet' type='text/css' href='"); | 802 | |
| 791 | html_attr(ctx.cfg.css); | 803 | if (ctx.cfg.css.items) |
| 792 | html("'/>\n"); | 804 | for_each_string_list(&ctx.cfg.css, emit_css_link, NULL); |
| 805 | else | ||
| 806 | emit_css_link(NULL, "/cgit.css"); | ||
| 807 | |||
| 793 | if (ctx.cfg.favicon) { | 808 | if (ctx.cfg.favicon) { |
| 794 | html("<link rel='shortcut icon' href='"); | 809 | html("<link rel='shortcut icon' href='"); |
| 795 | html_attr(ctx.cfg.favicon); | 810 | html_attr(ctx.cfg.favicon); |
