From 99c81764f66c0877a7ed66f5a03d52f948377678 Mon Sep 17 00:00:00 2001 From: equa Date: Thu, 6 Jan 2022 18:18:05 -0600 Subject: Add "default-tab" and "root-default-tab" configuration options These options allow the user to specify a page to display at the root repository/index location instead of the default summary or repository list. Signed-off-by: equa --- cmd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd.c') diff --git a/cmd.c b/cmd.c index 0eb75b1..64f6639 100644 --- a/cmd.c +++ b/cmd.c @@ -55,7 +55,7 @@ static void about_fn(void) cgit_redirect(ctx.repo->homepage, false); else { char *currenturl = cgit_currenturl(); - char *redirect = fmtalloc("%s../", currenturl); + char *redirect = cgit_pageurl(ctx.repo->url, "summary", NULL); cgit_redirect(redirect, false); free(currenturl); free(redirect); @@ -196,9 +196,9 @@ struct cgit_cmd *cgit_get_cmd(void) if (ctx.qry.page == NULL) { if (ctx.repo) - ctx.qry.page = "summary"; + ctx.qry.page = ctx.repo->default_tab; else - ctx.qry.page = "repolist"; + ctx.qry.page = ctx.cfg.root_default_tab; } for (i = 0; i < sizeof(cmds)/sizeof(*cmds); i++) -- cgit 1.3.0-6-gf8a5