{{ $letters := split "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "" }} {{ range $.Site.Pages.ByTitle }} {{ $firstChar := substr .Title 0 1 | upper }} {{ if $firstChar | in $letters }} {{ $curLetter := $.Scratch.Get "curLetter" }} {{ if ne $firstChar $curLetter }}
{{ $.Scratch.Set "curLetter" $firstChar }}
{{ $firstChar }}