{{- $term := .term }} {{- if eq "string" (printf "%T" $term) }} {{- $term = .page.GetPage $term }} {{- end }} {{- $headingstyle := .headingstyle | default "h2" }} {{- with $term }} {{- .Content }} {{- $lastCapital := "" }} {{- $pages := partialCached "partials/_relearn/pagesTerm.gotmpl" . .Path }} {{- range $pages }} {{- $capital := substr .Title 0 1 | upper }} {{- if ne $lastCapital $capital }} {{- if ne $lastCapital "" }} {{- end }} {{ (printf `<%s id="%s">%s%s>` $headingstyle ($capital | plainify | anchorize) $capital $headingstyle) | safeHTML }}