{{/* The tree and table of contents render twice, so Hugo's id on the table of contents goes. */}} {{ $toc := replace .TableOfContents ` id="TableOfContents"` "" | safeHTML }} {{ $hasToc := gt (len .Fragments.Headings) 0 }}