{{- /* Entry number of a post: 1-based position in date order across all posts, zero-padded to three digits. */ -}} {{- $p := . -}} {{- $no := 0 -}} {{- range $i, $e := (where site.RegularPages "Section" "posts").ByDate -}} {{- if eq $e $p }}{{ $no = add $i 1 }}{{ end -}} {{- end -}} {{- return printf "%03d" $no -}}