vanilla-hugo/layouts/partials/seriesnav.html
Danila Fedorin db9433bda1 Extract series navigation into a partial
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2024-06-19 21:56:00 -07:00

14 lines
508 B
HTML

{{ $term := index (.GetTerms "series") 0 }}
{{ with $term }}
{{- /* No idea why the 'Reverse' is needed? */ -}}
{{ $pages := (site.Taxonomies.series.Get .Data.Term).Pages.ByDate.Reverse }}
<nav id="SeriesNavigation" class="container">
{{ with $pages.Prev page }}
{{ partial "serieslink.html" (dict "direction" "previous" "link" .RelPermalink "page" .) }}
{{ end }}
{{ with $pages.Next page }}
{{ partial "serieslink.html" (dict "direction" "next" "link" .RelPermalink "page" .) }}
{{ end }}
</nav>
{{ end }}