{{/* alphabetical index of pages, grouped by first character of the title */}} {{ $groups := dict }} {{ range . }} {{ $l := upper (substr .Title 0 1) }} {{ if not (findRE `^[A-Z]$` $l) }}{{ $l = "#" }}{{ end }} {{ $groups = merge $groups (dict $l ((index $groups $l | default slice) | append .)) }} {{ end }}
{{ range $l, $_ := $groups }}{{ $l }} {{ end }}
{{ range $l, $pages := $groups }}