diff options
author | equa <equaa@protonmail.com> | 2022-01-06 18:18:05 -0600 |
---|---|---|
committer | equa <equaa@protonmail.com> | 2022-01-06 18:36:08 -0600 |
commit | 99c81764f66c0877a7ed66f5a03d52f948377678 (patch) | |
tree | 97626b497daa42b067e2ba2a49f8f9f56a240f39 /cmd.c | |
parent | 5258c297ba6fb604ae1415fbc19a3fe42457e49e (diff) |
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 <equaa@protonmail.com>
Diffstat (limited to 'cmd.c')
-rw-r--r-- | cmd.c | 6 |
1 files changed, 3 insertions, 3 deletions
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++) |