mirror of
https://git.zx2c4.com/cgit
synced 2025-07-02 22:34:32 +02:00
Make default pages configurable
Signed-off-by: Christian Hesse <mail@eworm.de>
This commit is contained in:
parent
00ecfaadea
commit
d9f3d6fb18
7 changed files with 48 additions and 13 deletions
18
cmd.c
18
cmd.c
|
@ -51,13 +51,10 @@ static void about_fn(void)
|
|||
free(redirect);
|
||||
} else if (ctx.repo->readme.nr)
|
||||
cgit_print_repo_readme(ctx.qry.path);
|
||||
else if (ctx.repo->homepage)
|
||||
cgit_redirect(ctx.repo->homepage, false);
|
||||
else {
|
||||
char *currenturl = cgit_currenturl();
|
||||
char *redirect = fmtalloc("%s../", currenturl);
|
||||
char *redirect = fmtalloc("%s%s/summary/",
|
||||
ctx.cfg.virtual_root, ctx.repo->url);
|
||||
cgit_redirect(redirect, false);
|
||||
free(currenturl);
|
||||
free(redirect);
|
||||
}
|
||||
} else
|
||||
|
@ -195,10 +192,13 @@ struct cgit_cmd *cgit_get_cmd(void)
|
|||
int i;
|
||||
|
||||
if (ctx.qry.page == NULL) {
|
||||
if (ctx.repo)
|
||||
ctx.qry.page = "summary";
|
||||
else
|
||||
ctx.qry.page = "repolist";
|
||||
if (ctx.repo) {
|
||||
if (ctx.repo->default_page && *ctx.repo->default_page)
|
||||
ctx.qry.page = ctx.repo->default_page;
|
||||
else
|
||||
ctx.qry.page = ctx.cfg.default_page;
|
||||
} else
|
||||
ctx.qry.page = ctx.cfg.root_default_page;
|
||||
}
|
||||
|
||||
for (i = 0; i < sizeof(cmds)/sizeof(*cmds); i++)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue