Back to Hugo

Toc

docs/layouts/_partials/layouts/toc.html

0.163.1536 B
Original Source

{{ with .Fragments }} {{ with .Headings }}

On this page

{{ end }} {{ end }} {{ define "render-toc-level" }} {{ range .h }} {{ if and .ID (and (ge .Level 2) (le .Level 4)) }} {{ $indentation := "ml-0" }} {{ if eq .Level 3 }} {{ $indentation = "ml-2 lg:ml-3" }} {{ else if eq .Level 4 }} {{ $indentation = "ml-4 lg:ml-6" }} {{ end }} {{ $.p.Store.Set "hasToc" true }} - {{ .Title | safeHTML }} {{ end }} {{ with .Headings }} {{ template "render-toc-level" (dict "h" . "p" $.p) }} {{ end }} {{ end }} {{ end }}