From f64bb3a19c276303f7502633ffa930a14aa883cc Mon Sep 17 00:00:00 2001 From: "Jason A. Dönerfield" Date: Sat, 11 Jul 2026 22:02:20 +0200 Subject: 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. --- cgit.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cgit.c') 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) -- cgit v1.3.1-sl0p