{{/* Parse toc.yaml and store the resulting map to $scratch */}} {{ $scratch := partialCached "utils/tocparser.html" . . }} {{ $ctx := . }} {{/* Get the name of the first section */}} {{ $firstSection := (index ($scratch.GetSortedMapValues "sections") 0).title }} {{/* Render the top-nav in sidebar for small screens */}} {{ if $firstSection }} {{ $allSections := slice }} {{ range $i, $e := ($scratch.GetSortedMapValues "sections") }} {{ $allSections = $allSections | append (index $e "title") }} {{ end }}