Files
hammerfest/layouts/partials/section-id.html
T
2026-09-30 16:19:00 -06:00

13 lines
372 B
HTML

{{/*
Anchor id for a section: its own `id`, else one made from its `toc`,
`kicker`, or `headline`. Shared by the section wrapper and the rail's
"On this page" index so the two always agree.
*/}}
{{ $id := "" }}
{{ with .id }}
{{ $id = . }}
{{ else }}
{{ with (or .toc .kicker .headline) }}{{ $id = . | plainify | anchorize }}{{ end }}
{{ end }}
{{ return $id }}