aboutsummaryrefslogtreecommitdiffstats
path: root/cgit.c
diff options
context:
space:
mode:
authorJason A. Dönerfield <no-replay@sl0p.foo>2026-07-11 22:02:20 +0200
committerJason A. Dönerfield <no-replay@sl0p.foo>2026-07-11 22:19:08 +0200
commitf64bb3a19c276303f7502633ffa930a14aa883cc (patch)
tree0734b6b680b0361b1dea916f7cddb2ff5de74b2f /cgit.c
parentBump version (diff)
downloadcgit-f64bb3a19c276303f7502633ffa930a14aa883cc.tar.gz
cgit-f64bb3a19c276303f7502633ffa930a14aa883cc.tar.xz
cgit-f64bb3a19c276303f7502633ffa930a14aa883cc.zip
ui-summary: optionally render the repo readme on the summary page
Add enable-summary-readme (global + per-repo repo.enable-summary-readme, default off). When enabled, the configured readme is rendered inline below the repository info on the summary page, in addition to the standard about page. Refactor the readme-rendering core out of cgit_print_repo_readme() into a static print_readme() helper (no layout wrapper) so the about page and the summary page share it.
Diffstat (limited to '')
-rw-r--r--cgit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index ca318e8..8bda5c9 100644
--- a/cgit.c
+++ b/cgit.c
@@ -72,6 +72,8 @@ void cgit_repo_config(struct cgit_repo *repo, const char *name, const char *valu
repo->enable_log_filecount = atoi(value);
else if (!strcmp(name, "enable-log-linecount"))
repo->enable_log_linecount = atoi(value);
+ else if (!strcmp(name, "enable-summary-readme"))
+ repo->enable_summary_readme = atoi(value);
else if (!strcmp(name, "enable-remote-branches"))
repo->enable_remote_branches = atoi(value);
else if (!strcmp(name, "enable-subject-links"))
@@ -191,6 +193,8 @@ static void config_cb(const char *name, const char *value)
ctx.cfg.enable_log_filecount = atoi(value);
else if (!strcmp(name, "enable-log-linecount"))
ctx.cfg.enable_log_linecount = atoi(value);
+ else if (!strcmp(name, "enable-summary-readme"))
+ ctx.cfg.enable_summary_readme = atoi(value);
else if (!strcmp(name, "enable-remote-branches"))
ctx.cfg.enable_remote_branches = atoi(value);
else if (!strcmp(name, "enable-subject-links"))
@@ -824,6 +828,8 @@ static void print_repo(FILE *f, struct cgit_repo *repo)
repo->enable_log_filecount);
fprintf(f, "repo.enable-log-linecount=%d\n",
repo->enable_log_linecount);
+ fprintf(f, "repo.enable-summary-readme=%d\n",
+ repo->enable_summary_readme);
if (repo->about_filter && repo->about_filter != ctx.cfg.about_filter)
cgit_fprintf_filter(repo->about_filter, f, "repo.about-filter=");
if (repo->commit_filter && repo->commit_filter != ctx.cfg.commit_filter)