vanilla-hugo/layouts/partials/seriesnav.html
Danila Fedorin acf86b8d76 Add a placeholder for "next in series" if the series is ongoing
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2024-06-26 19:48:55 -07:00

18 lines
650 B
HTML

{{- $page := . -}}
{{- $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 class="series-navigation">
{{- with $pages.Prev $page -}}
{{- partial "serieslink.html" (dict "direction" "previous" "page" .) -}}
{{- end -}}
{{- $nextPage := $pages.Next $page -}}
{{- if $nextPage -}}
{{- partial "serieslink.html" (dict "direction" "next" "page" $nextPage) -}}
{{- else if eq $term.Params.status "ongoing" -}}
{{- partial "serieslinkplaceholder.html" (dict "direction" "next") -}}
{{- end -}}
</nav>
{{- end -}}