From bce6be90883b107285faa56acf0081b54daa3aa9 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Sat, 8 Aug 2026 21:30:23 +0800 Subject: Initialize personal website --- layouts/partials/series-nav.html | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 layouts/partials/series-nav.html (limited to 'layouts/partials/series-nav.html') diff --git a/layouts/partials/series-nav.html b/layouts/partials/series-nav.html new file mode 100644 index 0000000..c88055c --- /dev/null +++ b/layouts/partials/series-nav.html @@ -0,0 +1,35 @@ +{{- $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 -}} -- cgit v1.2.3