{{- $page := .page -}} {{- $mode := .mode -}} {{- $pages := where $page.CurrentSection.RegularPages.ByWeight "Params.series" $page.Params.series -}} {{- $currentIndex := -1 -}} {{- range $index, $candidate := $pages -}} {{- if eq $candidate.RelPermalink $page.RelPermalink -}} {{- $currentIndex = $index -}} {{- end -}} {{- end -}} {{- if ge $currentIndex 0 -}} {{- $position := add $currentIndex 1 -}} {{- if eq $mode "position" }}
{{ $page.CurrentSection.LinkTitle }} {{ printf "%02d/%d" $position (len $pages) }}
{{- else if eq $mode "navigation" }} {{- end -}} {{- end -}}