{{/* Series Navigation — top-of-article banner for multi-part essays. Activates when frontmatter contains: series: name: 系列名 slug: ignite-and-settle order: N total: M Renders a compact card with: eyebrow, series title, "N / M" badge, and an inline ordered list of all parts (current highlighted). Looks across the same language only; uses series.slug to group. */}} {{- $page := . }} {{- $series := $page.Params.series }} {{- if and $series $series.slug }} {{- $slug := $series.slug }} {{- $isZh := eq $page.Lang "zh" }} {{/* Collect siblings: pages in the same language whose series.slug matches */}} {{- $siblings := slice }} {{- range where (where site.RegularPages "Lang" $page.Lang) "Params.series.slug" $slug }} {{- $siblings = $siblings | append . }} {{- end }} {{/* Sort by series.order ascending */}} {{- $ordered := sort $siblings "Params.series.order" "asc" }} {{- $order := $series.order | default 0 }} {{- $total := $series.total | default (len $ordered) }} {{- $eyebrow := cond $isZh "系列长文" "Series" }} {{- $partLabel := cond $isZh (printf "第 %d 篇 / 共 %d 篇" $order $total) (printf "Part %d of %d" $order $total) }} {{- end }}