Use config to hide values

This commit is contained in:
Will Faught
2024-07-17 18:25:34 -07:00
parent b17519532a
commit ada7e4c8c1
18 changed files with 491 additions and 419 deletions

View File

@@ -1,59 +1,52 @@
{{ $page := . }}
{{ $fileediturl := $page.Param "paige.file_edit_url" }}
{{ $filehistoryurl := $page.Param "paige.file_history_url" }}
{{ $file := false }}
{{ $fileediturl := $page.Param "paige.file_edit_url" | and ($page.Param "paige.page.hide_edit" | not) }}
{{ $filehistoryurl := $page.Param "paige.file_history_url" | and ($page.Param "paige.page.hide_history" | not) }}
{{ $first := templates.Exists "partials/paige/page-footer-first.html" }}
{{ $last := templates.Exists "partials/paige/page-footer-last.html" }}
{{ $next := $page.NextInSection }}
{{ $prev := $page.PrevInSection }}
{{ $next := $page.NextInSection | and ($page.Param "paige.page.hide_next" | not) }}
{{ $prev := $page.PrevInSection | and ($page.Param "paige.page.hide_prev" | not) }}
{{ if $page.File }}
{{ if $fileediturl }}
{{ $file = true }}
{{ $fileediturl = printf $fileediturl $page.File.Path }}
{{ end }}
{{ if $filehistoryurl }}
{{ $file = true }}
{{ $filehistoryurl = printf $filehistoryurl $page.File.Path }}
{{ end }}
{{ end }}
{{ if or $file $first $last $next $prev }}
<footer class="mt-3 mw-100 text-center text-secondary" id="paige-page-footer">
{{ if or $fileediturl $filehistoryurl $first $last $next $prev }}
<footer class="mw-100" id="paige-page-footer">
{{ if $first }}
{{ partial "paige/page-footer-first.html" . }}
{{ end }}
{{ if $file }}
<div class="mb-3" id="paige-file">
{{ if or $fileediturl $filehistoryurl }}
<div id="paige-file">
{{ if $fileediturl }}
<p class="mb-0" id="paige-file-edit">
<div class="paige-row-narrow text-center text-secondary" id="paige-edit">
<a class="link-secondary" href="{{ $fileediturl | safeURL }}">{{ i18n "paige_edit_this_page" }}</a>
</p>
</div>
{{ end }}
{{ if $filehistoryurl }}
<p class="mb-0" id="paige-file-history">
<div class="paige-row-narrow text-center text-secondary" id="paige-history">
<a class="link-secondary" href="{{ $filehistoryurl | safeURL }}">{{ i18n "paige_edit_history" }}</a>
</p>
</div>
{{ end }}
</div>
{{ end }}
{{ if or $next $prev }}
<div id="paige-prev-next">
<div id="paige-siblings">
{{ with $prev }}
<p class="mb-0" id="paige-next">
<a class="link-secondary" href="{{ .Permalink }}">{{ .Title }}</a> &rsaquo;
</p>
<div class="paige-row-narrow text-center text-secondary" id="paige-next"><a class="link-secondary" href="{{ .Permalink }}">{{ .Title }}</a> &rsaquo;</div>
{{ end }}
{{ with $next }}
<p class="mb-0" id="paige-prev">
&lsaquo; <a class="link-secondary" href="{{ .Permalink }}">{{ .Title }}</a>
</p>
<div class="paige-row-narrow text-center text-secondary" id="paige-prev">&lsaquo; <a class="link-secondary" href="{{ .Permalink }}">{{ .Title }}</a></div>
{{ end }}
</div>
{{ end }}