{{- define "main" }} {{- $isZh := eq .Lang "zh" -}} {{/* Order pages within this column by series.order if present, else by date */}} {{- $pages := .Pages.ByParam "series.order" -}} {{- if not $pages }}{{ $pages = .Pages.ByDate }}{{ end -}} {{- $total := len $pages -}}
{{/* ───────────────────────────────────────────────────────────── Masthead — magazine opening spread ───────────────────────────────────────────────────────────── */}}

{{ if $isZh }}系列专栏{{ else }}Column{{ end }}

{{ .Title }}

{{- with .Params.subtitle }}

{{ . }}

{{- end }}

{{- if $isZh }}共 {{ $total }} 篇{{ else }}{{ $total }} essays{{ end -}} {{- $totalReading := 0 -}} {{- range $pages -}} {{- $totalReading = add $totalReading .ReadingTime -}} {{- end -}} {{- if $totalReading }} · {{- if $isZh }}约 {{ $totalReading }} 分钟{{ else }}{{ $totalReading }} min total{{ end -}} {{- end }}

{{/* ───────────────────────────────────────────────────────────── Editorial intro — the column's standfirst / opening note ───────────────────────────────────────────────────────────── */}} {{- if .Content }}
{{ .Content }}
{{- end }} {{/* ───────────────────────────────────────────────────────────── Table of contents — numbered vertical roll of each essay ───────────────────────────────────────────────────────────── */}}

{{- if $isZh }}目录{{ else }}Contents{{ end -}}

    {{- range $i, $p := $pages -}} {{- $ord := $p.Params.series.order | default (add $i 1) }} {{- $padded := printf "%02d" $ord }}
  1. {{ $p.Title }}

    {{- with $p.Description }}

    {{ . }}

    {{- end }}
  2. {{- end }}
{{/* Footer rule */}}
{{- end }}