feat(pages): add app store links to downloads section
Some checks failed
Build and Release / Create Release (push) Successful in 0s
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 2m56s
Build and Release / Unit Tests (push) Successful in 8m52s
Build and Release / Lint (push) Successful in 9m21s
Build and Release / Build Binaries (amd64, darwin, macos) (push) Failing after 1s
Build and Release / Build Binaries (arm64, darwin, macos) (push) Failing after 1s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Successful in 4m54s
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Successful in 9h5m27s
Build and Release / Build Binary (linux/arm64) (push) Failing after 13m25s
Some checks failed
Build and Release / Create Release (push) Successful in 0s
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 2m56s
Build and Release / Unit Tests (push) Successful in 8m52s
Build and Release / Lint (push) Successful in 9m21s
Build and Release / Build Binaries (amd64, darwin, macos) (push) Failing after 1s
Build and Release / Build Binaries (arm64, darwin, macos) (push) Failing after 1s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Successful in 4m54s
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Successful in 9h5m27s
Build and Release / Build Binary (linux/arm64) (push) Failing after 13m25s
Add GooglePlayID and AppStoreID config fields to display app store download buttons on landing pages. Shows "App Stores" section with Google Play and/or App Store badges when IDs are configured. Useful for mobile apps distributed via stores instead of direct downloads. Includes branded SVG icons for both stores. Applies to all four page templates.
This commit is contained in:
@@ -310,6 +310,8 @@ type AdvancedConfig struct {
|
|||||||
Redirects map[string]string `yaml:"redirects,omitempty"`
|
Redirects map[string]string `yaml:"redirects,omitempty"`
|
||||||
PublicReleases bool `yaml:"public_releases,omitempty"`
|
PublicReleases bool `yaml:"public_releases,omitempty"`
|
||||||
HideMobileReleases bool `yaml:"hide_mobile_releases,omitempty"`
|
HideMobileReleases bool `yaml:"hide_mobile_releases,omitempty"`
|
||||||
|
GooglePlayID string `yaml:"google_play_id,omitempty"`
|
||||||
|
AppStoreID string `yaml:"app_store_id,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseLandingConfig parses a landing.yaml file content
|
// ParseLandingConfig parses a landing.yaml file content
|
||||||
|
|||||||
@@ -4497,6 +4497,10 @@
|
|||||||
"repo.settings.pages.public_releases": "Public Releases",
|
"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.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.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.google_play_id": "Google Play Store ID",
|
||||||
|
"repo.settings.pages.google_play_id_desc": "Package name from the Play Store URL (e.g. com.example.app)",
|
||||||
|
"repo.settings.pages.app_store_id": "Apple App Store ID",
|
||||||
|
"repo.settings.pages.app_store_id_desc": "App ID from the App Store URL (e.g. id123456789)",
|
||||||
"repo.settings.pages.stats": "Stats",
|
"repo.settings.pages.stats": "Stats",
|
||||||
"repo.settings.pages.value_props": "Value Propositions",
|
"repo.settings.pages.value_props": "Value Propositions",
|
||||||
"repo.settings.pages.features": "Features",
|
"repo.settings.pages.features": "Features",
|
||||||
|
|||||||
@@ -177,6 +177,8 @@ func setupLandingPageContext(ctx *context.Context, repo *repo_model.Repository,
|
|||||||
}
|
}
|
||||||
ctx.Data["PublicReleases"] = config.Advanced.PublicReleases
|
ctx.Data["PublicReleases"] = config.Advanced.PublicReleases
|
||||||
ctx.Data["HideMobileReleases"] = config.Advanced.HideMobileReleases
|
ctx.Data["HideMobileReleases"] = config.Advanced.HideMobileReleases
|
||||||
|
ctx.Data["GooglePlayID"] = config.Advanced.GooglePlayID
|
||||||
|
ctx.Data["AppStoreID"] = config.Advanced.AppStoreID
|
||||||
}
|
}
|
||||||
|
|
||||||
// galleryAssetBaseURL returns the base URL for gallery image assets.
|
// galleryAssetBaseURL returns the base URL for gallery image assets.
|
||||||
|
|||||||
@@ -447,6 +447,8 @@ func PagesContentPost(ctx *context.Context) {
|
|||||||
config := getPagesLandingConfig(ctx)
|
config := getPagesLandingConfig(ctx)
|
||||||
config.Advanced.PublicReleases = ctx.FormBool("public_releases")
|
config.Advanced.PublicReleases = ctx.FormBool("public_releases")
|
||||||
config.Advanced.HideMobileReleases = ctx.FormBool("hide_mobile_releases")
|
config.Advanced.HideMobileReleases = ctx.FormBool("hide_mobile_releases")
|
||||||
|
config.Advanced.GooglePlayID = strings.TrimSpace(ctx.FormString("google_play_id"))
|
||||||
|
config.Advanced.AppStoreID = strings.TrimSpace(ctx.FormString("app_store_id"))
|
||||||
config.Navigation.ShowDocs = ctx.FormBool("nav_show_docs")
|
config.Navigation.ShowDocs = ctx.FormBool("nav_show_docs")
|
||||||
config.Navigation.ShowAPI = ctx.FormBool("nav_show_api")
|
config.Navigation.ShowAPI = ctx.FormBool("nav_show_api")
|
||||||
config.Navigation.ShowRepository = ctx.FormBool("nav_show_repository")
|
config.Navigation.ShowRepository = ctx.FormBool("nav_show_repository")
|
||||||
|
|||||||
@@ -1355,6 +1355,25 @@
|
|||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
{{if or $.GooglePlayID $.AppStoreID}}
|
||||||
|
<div style="margin-bottom: 24px;">
|
||||||
|
<h4 style="display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; color: var(--nb-muted); text-transform: uppercase; letter-spacing: 0.1em;">{{svg "octicon-device-mobile" 16}} App Stores</h4>
|
||||||
|
<div style="display: flex; gap: 12px; flex-wrap: wrap;">
|
||||||
|
{{if $.GooglePlayID}}
|
||||||
|
<a href="https://play.google.com/store/apps/details?id={{$.GooglePlayID}}" target="_blank" rel="noopener" class="nb-download-item nb-reveal" style="display: inline-flex; align-items: center; gap: 10px;">
|
||||||
|
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M3.609 1.814L13.792 12 3.61 22.186a.996.996 0 0 1-.61-.92V2.734a1 1 0 0 1 .609-.92zm10.89 10.893l2.302 2.302-10.937 6.333 8.635-8.635zm3.199-1.4l2.834 1.64a1 1 0 0 1 0 1.726l-2.834 1.64-2.635-2.636 2.635-2.37zM5.864 2.658L16.8 9.99l-2.302 2.302-8.635-8.635z"/></svg>
|
||||||
|
Google Play
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
{{if $.AppStoreID}}
|
||||||
|
<a href="https://apps.apple.com/app/{{$.AppStoreID}}" target="_blank" rel="noopener" class="nb-download-item nb-reveal" style="display: inline-flex; align-items: center; gap: 10px;">
|
||||||
|
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.8-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"/></svg>
|
||||||
|
App Store
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
{{if $otherFiles}}
|
{{if $otherFiles}}
|
||||||
<div style="margin-bottom: 24px;">
|
<div style="margin-bottom: 24px;">
|
||||||
<h4 style="display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; color: var(--nb-muted); text-transform: uppercase; letter-spacing: 0.1em;">{{svg "octicon-file" 16}} Other</h4>
|
<h4 style="display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; color: var(--nb-muted); text-transform: uppercase; letter-spacing: 0.1em;">{{svg "octicon-file" 16}} Other</h4>
|
||||||
|
|||||||
@@ -1238,6 +1238,25 @@
|
|||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
{{if or $.GooglePlayID $.AppStoreID}}
|
||||||
|
<div style="margin-bottom: 20px;" class="ea-reveal">
|
||||||
|
<h4 style="display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ea-light); letter-spacing: 0.08em; text-transform: uppercase;">{{svg "octicon-device-mobile" 14}} App Stores</h4>
|
||||||
|
<div style="display: flex; gap: 12px; flex-wrap: wrap;">
|
||||||
|
{{if $.GooglePlayID}}
|
||||||
|
<a href="https://play.google.com/store/apps/details?id={{$.GooglePlayID}}" target="_blank" rel="noopener" class="ea-download-item" style="display: inline-flex; align-items: center; gap: 10px;">
|
||||||
|
<svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor"><path d="M3.609 1.814L13.792 12 3.61 22.186a.996.996 0 0 1-.61-.92V2.734a1 1 0 0 1 .609-.92zm10.89 10.893l2.302 2.302-10.937 6.333 8.635-8.635zm3.199-1.4l2.834 1.64a1 1 0 0 1 0 1.726l-2.834 1.64-2.635-2.636 2.635-2.37zM5.864 2.658L16.8 9.99l-2.302 2.302-8.635-8.635z"/></svg>
|
||||||
|
Google Play
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
{{if $.AppStoreID}}
|
||||||
|
<a href="https://apps.apple.com/app/{{$.AppStoreID}}" target="_blank" rel="noopener" class="ea-download-item" style="display: inline-flex; align-items: center; gap: 10px;">
|
||||||
|
<svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor"><path d="M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.8-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"/></svg>
|
||||||
|
App Store
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
{{if $otherFiles}}
|
{{if $otherFiles}}
|
||||||
<div style="margin-bottom: 20px;" class="ea-reveal">
|
<div style="margin-bottom: 20px;" class="ea-reveal">
|
||||||
<h4 style="display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ea-light); letter-spacing: 0.08em; text-transform: uppercase;">{{svg "octicon-file" 14}} Other</h4>
|
<h4 style="display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ea-light); letter-spacing: 0.08em; text-transform: uppercase;">{{svg "octicon-file" 14}} Other</h4>
|
||||||
|
|||||||
@@ -1230,6 +1230,25 @@
|
|||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
{{if or $.GooglePlayID $.AppStoreID}}
|
||||||
|
<div style="margin-bottom: 24px;">
|
||||||
|
<h4 style="display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; color: var(--osh-muted); font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.05em; text-transform: uppercase;">{{svg "octicon-device-mobile" 16}} App Stores</h4>
|
||||||
|
<div style="display: flex; gap: 12px; flex-wrap: wrap;">
|
||||||
|
{{if $.GooglePlayID}}
|
||||||
|
<a href="https://play.google.com/store/apps/details?id={{$.GooglePlayID}}" target="_blank" rel="noopener" class="osh-download-item" style="display: inline-flex; align-items: center; gap: 10px;">
|
||||||
|
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M3.609 1.814L13.792 12 3.61 22.186a.996.996 0 0 1-.61-.92V2.734a1 1 0 0 1 .609-.92zm10.89 10.893l2.302 2.302-10.937 6.333 8.635-8.635zm3.199-1.4l2.834 1.64a1 1 0 0 1 0 1.726l-2.834 1.64-2.635-2.636 2.635-2.37zM5.864 2.658L16.8 9.99l-2.302 2.302-8.635-8.635z"/></svg>
|
||||||
|
Google Play
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
{{if $.AppStoreID}}
|
||||||
|
<a href="https://apps.apple.com/app/{{$.AppStoreID}}" target="_blank" rel="noopener" class="osh-download-item" style="display: inline-flex; align-items: center; gap: 10px;">
|
||||||
|
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.8-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"/></svg>
|
||||||
|
App Store
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
{{if $otherFiles}}
|
{{if $otherFiles}}
|
||||||
<div style="margin-bottom: 24px;">
|
<div style="margin-bottom: 24px;">
|
||||||
<h4 style="display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; color: var(--osh-muted); font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.05em; text-transform: uppercase;">{{svg "octicon-file" 16}} Other</h4>
|
<h4 style="display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; color: var(--osh-muted); font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.05em; text-transform: uppercase;">{{svg "octicon-file" 16}} Other</h4>
|
||||||
|
|||||||
@@ -1356,6 +1356,25 @@
|
|||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
{{if or $.GooglePlayID $.AppStoreID}}
|
||||||
|
<div style="margin-bottom: 24px;">
|
||||||
|
<h4 style="display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; color: var(--gm-light); font-weight: 600;">{{svg "octicon-device-mobile" 16}} App Stores</h4>
|
||||||
|
<div style="display: flex; gap: 12px; flex-wrap: wrap;">
|
||||||
|
{{if $.GooglePlayID}}
|
||||||
|
<a href="https://play.google.com/store/apps/details?id={{$.GooglePlayID}}" target="_blank" rel="noopener" class="gm-download-item gm-reveal" style="display: inline-flex; align-items: center; gap: 10px;">
|
||||||
|
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M3.609 1.814L13.792 12 3.61 22.186a.996.996 0 0 1-.61-.92V2.734a1 1 0 0 1 .609-.92zm10.89 10.893l2.302 2.302-10.937 6.333 8.635-8.635zm3.199-1.4l2.834 1.64a1 1 0 0 1 0 1.726l-2.834 1.64-2.635-2.636 2.635-2.37zM5.864 2.658L16.8 9.99l-2.302 2.302-8.635-8.635z"/></svg>
|
||||||
|
Google Play
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
{{if $.AppStoreID}}
|
||||||
|
<a href="https://apps.apple.com/app/{{$.AppStoreID}}" target="_blank" rel="noopener" class="gm-download-item gm-reveal" style="display: inline-flex; align-items: center; gap: 10px;">
|
||||||
|
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.8-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"/></svg>
|
||||||
|
App Store
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
{{if $otherFiles}}
|
{{if $otherFiles}}
|
||||||
<div style="margin-bottom: 24px;">
|
<div style="margin-bottom: 24px;">
|
||||||
<h4 style="display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; color: var(--gm-light); font-weight: 600;">{{svg "octicon-file" 16}} Other</h4>
|
<h4 style="display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; color: var(--gm-light); font-weight: 600;">{{svg "octicon-file" 16}} Other</h4>
|
||||||
|
|||||||
@@ -52,6 +52,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="two fields">
|
||||||
|
<div class="field">
|
||||||
|
<label>{{ctx.Locale.Tr "repo.settings.pages.google_play_id"}}</label>
|
||||||
|
<input name="google_play_id" value="{{.Config.Advanced.GooglePlayID}}" placeholder="com.example.app">
|
||||||
|
<p class="help">{{ctx.Locale.Tr "repo.settings.pages.google_play_id_desc"}}</p>
|
||||||
|
</div>
|
||||||
|
<div class="field">
|
||||||
|
<label>{{ctx.Locale.Tr "repo.settings.pages.app_store_id"}}</label>
|
||||||
|
<input name="app_store_id" value="{{.Config.Advanced.AppStoreID}}" placeholder="id123456789">
|
||||||
|
<p class="help">{{ctx.Locale.Tr "repo.settings.pages.app_store_id_desc"}}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.pages.blog_section"}}</h5>
|
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.pages.blog_section"}}</h5>
|
||||||
<div class="inline field">
|
<div class="inline field">
|
||||||
<div class="ui toggle checkbox">
|
<div class="ui toggle checkbox">
|
||||||
|
|||||||
Reference in New Issue
Block a user