diff options
Diffstat (limited to 'ui-summary.c')
-rw-r--r-- | ui-summary.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/ui-summary.c b/ui-summary.c index 947812a..6e04c55 100644 --- a/ui-summary.c +++ b/ui-summary.c @@ -62,6 +62,7 @@ void cgit_print_summary(void) urls = 0; cgit_add_clone_urls(print_url); html("</table>"); + cgit_print_repo_readme(ctx.qry.path, false); cgit_print_layout_end(); } @@ -99,22 +100,25 @@ static char* append_readme_path(const char *filename, const char *ref, const cha return full_path; } -void cgit_print_repo_readme(const char *path) +void cgit_print_repo_readme(const char *path, bool page) { char *filename, *ref, *mimetype; int free_filename = 0; mimetype = get_mimetype_for_filename(path); if (mimetype && (!strncmp(mimetype, "image/", 6) || !strncmp(mimetype, "video/", 6))) { - ctx.page.mimetype = mimetype; - ctx.page.charset = NULL; - cgit_print_plain(); + if (page) { + ctx.page.mimetype = mimetype; + ctx.page.charset = NULL; + cgit_print_plain(); + } free(mimetype); return; } free(mimetype); - cgit_print_layout_start(); + if (page) + cgit_print_layout_start(); if (ctx.repo->readme.nr == 0) goto done; @@ -131,6 +135,10 @@ void cgit_print_repo_readme(const char *path) /* Print the calculated readme, either from the git repo or from the * filesystem, while applying the about-filter. */ + if (!page) { + html("</div>"); + html("<div class=\"content\">"); + } html("<div id='summary'>"); cgit_open_filter(ctx.repo->about_filter, filename); if (ref) @@ -144,5 +152,6 @@ void cgit_print_repo_readme(const char *path) free(filename); done: - cgit_print_layout_end(); + if (page) + cgit_print_layout_end(); } |