From d946c8cf11385f5766e827ae71b3fc798750a335 Mon Sep 17 00:00:00 2001 From: justanothercatgirl Date: Wed, 2 Apr 2025 21:00:51 +0200 Subject: Added default_index config parameter. Note: currently breaks repos that contain no readme --- cgit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cgit.c') diff --git a/cgit.c b/cgit.c index 2efa962..d256b14 100644 --- a/cgit.c +++ b/cgit.c @@ -153,6 +153,8 @@ static void config_cb(const char *name, const char *value) ctx.cfg.footer = xstrdup(value); else if (!strcmp(name, "head-include")) ctx.cfg.head_include = xstrdup(value); + else if (!strcmp(name, "default-index")) + ctx.cfg.default_index = xstrdup(value); else if (!strcmp(name, "header")) ctx.cfg.header = xstrdup(value); else if (!strcmp(name, "logo")) @@ -412,6 +414,7 @@ static void prepare_context(void) ctx.cfg.summary_tags = 10; ctx.cfg.max_atom_items = 10; ctx.cfg.difftype = DIFF_UNIFIED; + ctx.cfg.default_index = "summary"; ctx.env.cgit_config = getenv("CGIT_CONFIG"); ctx.env.http_host = getenv("HTTP_HOST"); ctx.env.https = getenv("HTTPS"); @@ -1065,8 +1068,8 @@ int cmd_main(int argc, const char **argv) prepare_context(); cgit_repolist.length = 0; - cgit_repolist.count = 0; cgit_repolist.repos = NULL; + cgit_repolist.count = 0; cgit_parse_args(argc, argv); parse_configfile(expand_macros(ctx.env.cgit_config), config_cb); -- cgit v1.2.3-70-g09d2