{{- if or (eq .Kind "taxonomy") (eq .Kind "term") }} {{- $lastCapital := "" }} {{- $pages := slice }} {{- if eq .Kind "taxonomy" }} {{- $pages = partialCached "partials/_relearn/pagesTaxonomy.gotmpl" . . }} {{- else if eq .Kind "term" }} {{- $pages = partialCached "partials/_relearn/pagesTerm.gotmpl" . . }} {{- end }} {{- $toc_pages := "" }} {{- range $pages }} {{- $capital := substr .Title 0 1 | upper }} {{- if ne $lastCapital $capital }} {{- $toc_pages = printf "%s