summaryrefslogtreecommitdiff
path: root/layouts/partials/recursive_nav.html
blob: 4a3ed2cfbb49268fc2f60b9a4d7c446be42303cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12

{{ $currentPage := .currentPage }}
<ul>
	{{ range .pages }}
		{{ $isCurrentOrAncestor := or (eq $currentPage .) ($currentPage.IsDescendant .) }}
		<li {{ if eq $currentPage . }}class="nav-current"{{ end }}>
			<a href="{{ .RelPermalink }}">{{ .Title }}</a>
		</li>
		{{ if and .Pages $isCurrentOrAncestor }}
			{{ partial "recursive_nav.html" (dict "currentPage" $currentPage "pages" .Pages) }}
		{{ end }}
	{{ end }}
</ul>