{{ define "li" -}} {{ $s := .section -}} {{ $p := .page -}} {{ $treeRoot := cond (eq .ulNr 0) true false -}} {{ $ulNr := .ulNr -}} {{ $ulShow := .ulShow -}} {{ $active := eq $s $p -}} {{ $activePath := $p.IsDescendant $s -}} {{ $show := cond (or (lt $ulNr $ulShow) $activePath (eq $s.Parent $p.Parent) (eq $s.Parent $p) ($p.IsDescendant $s.Parent)) true false -}} {{ $pages := (union $s.Pages $s.Sections).ByWeight -}} {{ $withChild := gt (len $pages) 0 -}} {{ $rootDir := lt $ulNr 1 -}} {{ if and $show (not (default false $s.Params.hidden)) }}