Hugo site: layouts, config and pilot content
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YDRjtmAiNpo5mK5N3d7QwZ
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
{{/* 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 }}
|
||||
<p class="letters">
|
||||
{{ range $l, $_ := $groups }}<a href="#letter-{{ $l | urlize }}">{{ $l }}</a> {{ end }}
|
||||
</p>
|
||||
{{ range $l, $pages := $groups }}
|
||||
<h2 id="letter-{{ $l | urlize }}">{{ $l }}</h2>
|
||||
{{ partial "page-list.html" $pages }}
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user