diff options
| author | vosjedev <vosje+git@vosjedev.net> | 2025-10-10 19:34:29 +0200 |
|---|---|---|
| committer | Vosjedev <vosje@vosjedev.net> | 2026-01-22 12:38:02 +0100 |
| commit | 94502a2216870e1ca6b18afb19c21fb1215792a2 (patch) | |
| tree | 6dedb79b069708bf564a78ffb3df81554fc64bbb /ui-summary.c | |
| parent | 76abc4068222fe4242a952498e252a670615c362 (diff) | |
| download | cgit-94502a2216870e1ca6b18afb19c21fb1215792a2.tar.gz cgit-94502a2216870e1ca6b18afb19c21fb1215792a2.tar.bz2 cgit-94502a2216870e1ca6b18afb19c21fb1215792a2.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(); } |
