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:
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user