2
0

feat(pages): add option to hide mobile releases from landing page

Add HideMobileReleases config option to hide Android and iOS releases from the downloads section on landing pages. Useful when mobile apps are distributed via app stores rather than direct downloads. Adds checkbox in Content settings and conditional rendering in all four page templates.
This commit is contained in:
2026-03-16 01:22:52 -04:00
parent c7b5a2af19
commit 5e165b97be
9 changed files with 23 additions and 4 deletions

View File

@@ -163,6 +163,7 @@ func setupLandingPageContext(ctx *context.Context, repo *repo_model.Repository,
ctx.Data["LatestReleaseTag"] = strings.TrimPrefix(release.TagName, "v")
}
ctx.Data["PublicReleases"] = config.Advanced.PublicReleases
ctx.Data["HideMobileReleases"] = config.Advanced.HideMobileReleases
}
// renderLandingPage renders the landing page based on the template

View File

@@ -446,6 +446,7 @@ func PagesContent(ctx *context.Context) {
func PagesContentPost(ctx *context.Context) {
config := getPagesLandingConfig(ctx)
config.Advanced.PublicReleases = ctx.FormBool("public_releases")
config.Advanced.HideMobileReleases = ctx.FormBool("hide_mobile_releases")
config.Navigation.ShowDocs = ctx.FormBool("nav_show_docs")
config.Navigation.ShowAPI = ctx.FormBool("nav_show_api")
config.Navigation.ShowRepository = ctx.FormBool("nav_show_repository")