diff options
| author | vosjedev <vosje+git@vosjedev.net> | 2025-10-10 19:34:29 +0200 |
|---|---|---|
| committer | vosjedev <vosje+git@vosjedev.net> | 2025-10-10 19:34:29 +0200 |
| commit | cd99253de289b28134b185803eb02b617b23ea81 (patch) | |
| tree | a22ab7a550417ea4156a257340d4859249f56896 /ui-summary.c | |
| parent | 51b0e8520c4ec4d246511f272b3764d6dbed0943 (diff) | |
| download | cgit-cd99253de289b28134b185803eb02b617b23ea81.tar.gz cgit-cd99253de289b28134b185803eb02b617b23ea81.tar.bz2 cgit-cd99253de289b28134b185803eb02b617b23ea81.tar.xz | |
ui-summary: add the readme to the summary page
Add the readme to the summary page. Also add some css.
Signed-off-by: vosjedev <vosje+git@vosjedev.net>
Diffstat (limited to 'ui-summary.c')
| -rw-r--r-- | ui-summary.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ui-summary.c b/ui-summary.c index 947812a..4f6b34d 100644 --- a/ui-summary.c +++ b/ui-summary.c @@ -62,6 +62,33 @@ void cgit_print_summary(void) urls = 0; cgit_add_clone_urls(print_url); html("</table>"); + + /* the following code was modified from cgit_print_repo_readme() */ + + if (ctx.repo->readme.nr >= 1) { + char *filename, *ref; + + filename = ctx.repo->readme.items[0].string; + ref = ctx.repo->readme.items[0].util; + + /* Print the calculated readme, either from the git repo or from the + * filesystem, while applying the about-filter. + */ + html("<div id='summary' class='embedded-readme'>"); + cgit_open_filter(ctx.repo->about_filter, filename); + if (ref) + cgit_print_file(filename, ref, 1); + else + html_include(filename); + cgit_close_filter(ctx.repo->about_filter); + + html("</div>"); + } + + + /* end of code taken from cgit_print_repo_readme() */ + + cgit_print_layout_end(); } |
