{{ $child_pages := union .Sections .Pages }} <ul> {{ range $child_pages.ByTitle }} <li> <a href="{{ .RelPermalink }}"> {{ .Title }} </a> {{ if or (.Sections) (.Pages) }} {{ partial "recursive-pages.html" . }} {{ end }} </li> {{ end }} </ul>