Add a placeholder for "next in series" if the series is ongoing

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
2024-06-26 19:48:55 -07:00
parent a5cda19e5e
commit acf86b8d76
4 changed files with 22 additions and 5 deletions

View File

@@ -5,10 +5,13 @@
{{- $pages := (site.Taxonomies.series.Get .Data.Term).Pages.ByDate.Reverse -}}
<nav class="series-navigation">
{{- with $pages.Prev $page -}}
{{- partial "serieslink.html" (dict "direction" "previous" "link" .RelPermalink "page" .) -}}
{{- partial "serieslink.html" (dict "direction" "previous" "page" .) -}}
{{- end -}}
{{- with $pages.Next $page -}}
{{- partial "serieslink.html" (dict "direction" "next" "link" .RelPermalink "page" .) -}}
{{- $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 -}}