{{ template "section-tree-nav" . }} {{ define "section-tree-nav" }} {{ $sections := where (union .Pages .Sections).ByWeight ".Params.toc_hide" "!=" true }} {{ range $sections }} {{ if .IsPage }} {{ template "section-tree-nav-page" . }} {{ else }} {{ template "section-tree-nav-section" . }} {{ end }} {{ end }} {{ end }} {{ define "section-tree-nav-section" }}
{{ if ge (len .Content) 10 }} {{/* The section page has content, so link to it. */}} {{ end }} {{ template "section-tree-nav" . }}
{{ end }} {{ define "section-tree-nav-page" }} {{ end }}