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:
@@ -1337,6 +1337,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if not $.HideMobileReleases}}
|
||||
{{if $androidFiles}}
|
||||
<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}} Android</h4>
|
||||
@@ -1353,6 +1354,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if $otherFiles}}
|
||||
<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>
|
||||
|
||||
@@ -1220,6 +1220,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if not $.HideMobileReleases}}
|
||||
{{if $androidFiles}}
|
||||
<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}} Android</h4>
|
||||
@@ -1236,6 +1237,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if $otherFiles}}
|
||||
<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>
|
||||
|
||||
@@ -1212,6 +1212,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if not $.HideMobileReleases}}
|
||||
{{if $androidFiles}}
|
||||
<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}} Android</h4>
|
||||
@@ -1228,6 +1229,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if $otherFiles}}
|
||||
<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>
|
||||
|
||||
@@ -1338,6 +1338,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if not $.HideMobileReleases}}
|
||||
{{if $androidFiles}}
|
||||
<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}} Android</h4>
|
||||
@@ -1354,6 +1355,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if $otherFiles}}
|
||||
<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>
|
||||
|
||||
@@ -45,6 +45,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="inline field">
|
||||
<div class="ui toggle checkbox">
|
||||
<input type="checkbox" name="hide_mobile_releases" {{if .Config.Advanced.HideMobileReleases}}checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "repo.settings.pages.hide_mobile_releases_desc"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.pages.blog_section"}}</h5>
|
||||
<div class="inline field">
|
||||
<div class="ui toggle checkbox">
|
||||
|
||||
Reference in New Issue
Block a user