Update for new Hugo versions
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
17
layouts/_partials/seriesnav.html
Normal file
17
layouts/_partials/seriesnav.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{{- $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 -}}
|
||||
Reference in New Issue
Block a user