{{ T "tableOfContents" }}
    {{ range (.Scratch.Get "headings") }} {{/* add left padding depending on level (pl-2, pl-3, pl-4) */}} {{ $slice := strings.Split .text "{#" }} {{ $text := index $slice 0 }} {{ $anchor := index $slice 1 | strings.TrimRight "}" }} {{ markdownify $text }} {{ end }}