diff --git a/modules/pages/config.go b/modules/pages/config.go index 16c208324b..532a7c6a6b 100644 --- a/modules/pages/config.go +++ b/modules/pages/config.go @@ -305,10 +305,11 @@ func LanguageDisplayNames() map[string]string { // AdvancedConfig represents advanced settings type AdvancedConfig struct { - CustomCSS string `yaml:"custom_css,omitempty"` - CustomHead string `yaml:"custom_head,omitempty"` - Redirects map[string]string `yaml:"redirects,omitempty"` - PublicReleases bool `yaml:"public_releases,omitempty"` + CustomCSS string `yaml:"custom_css,omitempty"` + CustomHead string `yaml:"custom_head,omitempty"` + Redirects map[string]string `yaml:"redirects,omitempty"` + PublicReleases bool `yaml:"public_releases,omitempty"` + HideMobileReleases bool `yaml:"hide_mobile_releases,omitempty"` } // ParseLandingConfig parses a landing.yaml file content diff --git a/options/locale/locale_en-US.json b/options/locale/locale_en-US.json index 4ad73dfbcb..30eed15e68 100644 --- a/options/locale/locale_en-US.json +++ b/options/locale/locale_en-US.json @@ -4496,6 +4496,7 @@ "repo.settings.pages.cta_url": "Button URL", "repo.settings.pages.public_releases": "Public Releases", "repo.settings.pages.public_releases_desc": "Allow unauthenticated users to download releases. Useful for landing pages on private repositories.", + "repo.settings.pages.hide_mobile_releases_desc": "Hide mobile platform releases (Android, iOS) from the landing page. Use this when mobile releases are distributed via app stores.", "repo.settings.pages.stats": "Stats", "repo.settings.pages.value_props": "Value Propositions", "repo.settings.pages.features": "Features", diff --git a/routers/web/pages/pages.go b/routers/web/pages/pages.go index 3e352db963..98f4c4c57b 100644 --- a/routers/web/pages/pages.go +++ b/routers/web/pages/pages.go @@ -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 diff --git a/routers/web/repo/setting/pages.go b/routers/web/repo/setting/pages.go index 3b9f61e709..ac3d339a0c 100644 --- a/routers/web/repo/setting/pages.go +++ b/routers/web/repo/setting/pages.go @@ -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") diff --git a/templates/pages/bold-marketing.tmpl b/templates/pages/bold-marketing.tmpl index a743ec3b83..7c62261784 100644 --- a/templates/pages/bold-marketing.tmpl +++ b/templates/pages/bold-marketing.tmpl @@ -1337,6 +1337,7 @@ {{end}} + {{if not $.HideMobileReleases}} {{if $androidFiles}}