{{- define "main" }} {{- $lang := .Lang }} {{- $isZh := eq $lang "zh" }} {{- $sectionPages := where .RegularPages "Lang" $lang }} {{- $growthPages := $sectionPages.ByDate.Reverse }} {{- $featured := first 3 $growthPages }}
{{/* ── Hero ── */}}
{{ if $isZh }}成长与生活{{ else }}Growth & Life{{ end }}

{{- if $isZh }} 记录 每一步蜕变 {{- else }} Documenting Every Evolution {{- end }}

{{- if .Description }}{{ .Description | markdownify }} {{- else if $isZh }}年度回顾、效率系统、阅读沉淀——在不断精进中寻找生活的节奏 {{- else }}Annual reviews, productivity systems, reading reflections — finding rhythm in continuous refinement {{- end }}

{{ len $growthPages }} {{ if $isZh }}文章{{ else }}Articles{{ end }}
{{- $categories := slice }} {{- range $growthPages }} {{- range .Params.categories }} {{- $categories = $categories | append . }} {{- end }} {{- end }} {{- $uniqueCats := $categories | uniq }}
{{ len $uniqueCats }} {{ if $isZh }}主题{{ else }}Topics{{ end }}
{{- if $growthPages }} {{- $earliest := (index (sort $growthPages "Date" "asc") 0) }}
{{ $earliest.Date.Format "2006" }} {{ if $isZh }}起始{{ else }}Since{{ end }}
{{- end }}
{{/* ── Featured Trio ── */}} {{- if $featured }} {{- end }} {{/* ── Full Archive ── */}}
{{- $paginator := .Paginate $growthPages 20 }} {{- $currentYear := "" }}
{{- range $paginator.Pages }} {{- $year := .Date.Format "2006" }} {{- if ne $year $currentYear }} {{- $currentYear = $year }}
{{ $year }}
{{- end }}
{{- with .Params.categories }} {{ index . 0 }} {{- end }}

{{ .Title }}

{{- if .Params.tags }}
{{- range first 3 .Params.tags }} {{ . }} {{- end }}
{{- end }}
{{- end }}
{{- if gt $paginator.TotalPages 1 }} {{- end }}
{{- end }}