{{ $s := partialCached "scratch.html" . }} {{ $currentNode := . }} {{ $currentDir := "" }} {{ with .File }} {{ $currentDir = .Dir }} {{ end }} {{ $currentFile := (printf "/%s" .File) }} {{ $scratch := $s.Get $currentFile }} {{ $has_children := true }} {{ if isset $scratch "has_children" }} {{ if eq (len $scratch.has_children) 1 }} {{ if not (index $scratch.has_children 0) }} {{ $has_children = false }} {{ end }} {{ end }} {{ end }}