mirror of
https://git.zx2c4.com/cgit
synced 2024-11-09 18:18:42 +00:00
cmd: redirect empty about/ to homepage or summary
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
5f2664f13c
commit
94c02bbf73
11
cmd.c
11
cmd.c
@ -47,8 +47,17 @@ static void about_fn(void)
|
|||||||
cgit_redirect(redirect, true);
|
cgit_redirect(redirect, true);
|
||||||
free(currenturl);
|
free(currenturl);
|
||||||
free(redirect);
|
free(redirect);
|
||||||
} else
|
} else if (ctx.repo->readme.nr)
|
||||||
cgit_print_repo_readme(ctx.qry.path);
|
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);
|
||||||
|
cgit_redirect(redirect, false);
|
||||||
|
free(currenturl);
|
||||||
|
free(redirect);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
cgit_print_site_readme();
|
cgit_print_site_readme();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user