Refactor next, prev values

master
Will Faught 12 months ago
parent 8c09422aa0
commit 0c70c5a169

@ -2,6 +2,8 @@
{{ $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" }}
{{ $next := $page.NextInSection }}
{{ $prev := $page.PrevInSection }}
{{ if $page.File }} {{ if $page.File }}
{{ if $fileediturl }} {{ if $fileediturl }}
@ -18,15 +20,15 @@
{{ partial "paige/page-footer-first.html" . }} {{ partial "paige/page-footer-first.html" . }}
{{ end }} {{ end }}
{{ if or $page.PrevInSection $page.NextInSection }} {{ if or $next $prev }}
<div class="mb-3" id="paige-prev-next"> <div class="mb-3" id="paige-prev-next">
{{ with $page.PrevInSection }} {{ with $prev }}
<p class="mb-0" id="paige-next"> <p class="mb-0" id="paige-next">
<a class="link-secondary" href="{{ .Permalink }}">{{ .Title }}</a> &rsaquo; <a class="link-secondary" href="{{ .Permalink }}">{{ .Title }}</a> &rsaquo;
</p> </p>
{{ end }} {{ end }}
{{ with $page.NextInSection }} {{ with $next }}
<p class="mb-0" id="paige-prev"> <p class="mb-0" id="paige-prev">
&lsaquo; <a class="link-secondary" href="{{ .Permalink }}">{{ .Title }}</a> &lsaquo; <a class="link-secondary" href="{{ .Permalink }}">{{ .Title }}</a>
</p> </p>

Loading…
Cancel
Save