{{ define "page-list" }} {{ if (or .Params.list_pages (not .Content)) }} {{ if .Params.list_pages }} {{ range .RegularPages.ByParam (or .Params.order_by "date" ) }}

{{ .Date.Format "2006-01-02" }} {{ .Title | markdownify }} {{ with .Params.subtitle }} · {{ . | markdownify }} {{ end }}

{{ end }} {{ else }} {{ range .RegularPages.GroupByDate "2006" }}

{{ .Key }}

{{ range .Pages.GroupByDate "01" }} {{ end }} {{ end }}
{{- $words := 0 -}}{{- $chars := 0 -}}{{- $runes := 0 -}} {{- range .RegularPages -}} {{- $words = add $words .WordCount -}} {{- $chars = add $chars (split (replace .Plain "\n" "") "" | len) -}} {{- $runes = add $runes (countrunes .Plain) -}} {{- end -}} {{- partial (cond (eq .Section "cn") "stats_cn.html" "stats_en.html") (dict "Years" (.RegularPages.GroupByDate "2006" | len) "Posts" (len .RegularPages | lang.FormatNumberCustom 0) "Words" (lang.FormatNumberCustom 0 $words) "Runes" (lang.FormatNumberCustom 0 $runes) "Chars" (lang.FormatNumberCustom 0 $chars)) -}}
{{ end }} {{ end }} {{ end }}