summaryrefslogtreecommitdiff
path: root/layouts/recordings/single.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/recordings/single.html')
-rw-r--r--layouts/recordings/single.html17
1 files changed, 15 insertions, 2 deletions
diff --git a/layouts/recordings/single.html b/layouts/recordings/single.html
index 96ddd42..1cd0e51 100644
--- a/layouts/recordings/single.html
+++ b/layouts/recordings/single.html
@@ -44,12 +44,25 @@
{{ .Content }}
</main>
+ {{ $pages := .CurrentSection.Pages.ByDate.Reverse }}
+ {{ $.Scratch.Set "older" nil }}
+ {{ $.Scratch.Set "newer" nil }}
+ {{ range $i, $p := $pages }}
+ {{ if eq $p.File.Path $.File.Path }}
+ {{ if lt (add $i 1) (len $pages) }}
+ {{ $.Scratch.Set "older" (index $pages (add $i 1)) }}
+ {{ end }}
+ {{ if gt $i 0 }}
+ {{ $.Scratch.Set "newer" (index $pages (sub $i 1)) }}
+ {{ end }}
+ {{ end }}
+ {{ end }}
<footer>
<div class="nav">
- {{ with .NextInSection }}
+ {{ with $.Scratch.Get "older" }}
<a class="btn" href="{{ .RelPermalink }}">← Before</a>
{{ end }}
- {{ with .PrevInSection }}
+ {{ with $.Scratch.Get "newer" }}
<a class="btn" href="{{ .RelPermalink }}">Next →</a>
{{ end }}
</div>