Files
documentation/layouts/_partials/pager.html
T
2026-10-20 09:41:46 -06:00

16 lines
653 B
HTML

{{ $pages := slice }}
{{ if eq .Section "apps" }}
{{ $pages = (site.GetPage "/apps").Pages.ByTitle }}
{{ else }}
{{ with .CurrentSection }}{{ $pages = .Pages.ByWeight }}{{ end }}
{{ end }}
{{ if and $pages (not .IsSection) }}
{{ $prev := $pages.Prev . }}
{{ $next := $pages.Next . }}
{{/* Pages.Next/Prev are reversed relative to reading order */}}
<nav class="pager" aria-label="Previous and next">
{{ with $next }}<a class="pager-prev" href="{{ .RelPermalink }}"><span>Previous</span>{{ .LinkTitle }}</a>{{ end }}
{{ with $prev }}<a class="pager-next" href="{{ .RelPermalink }}"><span>Next</span>{{ .LinkTitle }}</a>{{ end }}
</nav>
{{ end }}