Have page footer only if needed

master
Will Faught 12 months ago
parent fd469910de
commit f0978c71a7

@ -2,21 +2,27 @@
{{ $fileediturl := $page.Param "paige.file_edit_url" }} {{ $fileediturl := $page.Param "paige.file_edit_url" }}
{{ $filehistoryurl := $page.Param "paige.file_history_url" }} {{ $filehistoryurl := $page.Param "paige.file_history_url" }}
{{ $file := false }}
{{ $first := templates.Exists "partials/paige/page-footer-first.html" }}
{{ $last := templates.Exists "partials/paige/page-footer-last.html" }}
{{ $next := $page.NextInSection }} {{ $next := $page.NextInSection }}
{{ $prev := $page.PrevInSection }} {{ $prev := $page.PrevInSection }}
{{ if $page.File }} {{ if $page.File }}
{{ if $fileediturl }} {{ if $fileediturl }}
{{ $file = true }}
{{ $fileediturl = printf $fileediturl $page.File.Path }} {{ $fileediturl = printf $fileediturl $page.File.Path }}
{{ end }} {{ end }}
{{ if $filehistoryurl }} {{ if $filehistoryurl }}
{{ $file = true }}
{{ $filehistoryurl = printf $filehistoryurl $page.File.Path }} {{ $filehistoryurl = printf $filehistoryurl $page.File.Path }}
{{ end }} {{ end }}
{{ end }} {{ end }}
<footer class="mt-3 text-center text-secondary" id="paige-page-footer"> {{ if or $file $first $last $next $prev }}
{{ if templates.Exists "partials/paige/page-footer-first.html" }} <footer class="mt-3 mw-100 text-center text-secondary" id="paige-page-footer">
{{ if $first }}
{{ partial "paige/page-footer-first.html" . }} {{ partial "paige/page-footer-first.html" . }}
{{ end }} {{ end }}
@ -36,7 +42,7 @@
</div> </div>
{{ end }} {{ end }}
{{ if and $page.File (or $fileediturl $filehistoryurl) }} {{ if $file }}
<div id="paige-file"> <div id="paige-file">
{{ if $fileediturl }} {{ if $fileediturl }}
<p class="mb-0" id="paige-file-edit"> <p class="mb-0" id="paige-file-edit">
@ -52,7 +58,8 @@
</div> </div>
{{ end }} {{ end }}
{{ if templates.Exists "partials/paige/page-footer-last.html" }} {{ if $last }}
{{ partial "paige/page-footer-last.html" . }} {{ partial "paige/page-footer-last.html" . }}
{{ end }} {{ end }}
</footer> </footer>
{{ end }}

Loading…
Cancel
Save