1
Fork 0

Show static pages in navbar

This commit is contained in:
Jake Howard 2017-11-12 15:36:36 +00:00
parent 4793a2abdd
commit 8af06a4c55
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -1,11 +1,13 @@
{{ $home := .Site.GetPage "home" }}
{{ range where .Site.Pages.ByTitle "Kind" "section" }}
{{ if eq .Parent $home }}
{{ $sections := where (where .Site.Pages.ByTitle "Kind" "section") "Parent.UniqueID" $home.UniqueID }}
{{ $pages := where (where .Site.Pages.ByTitle "Kind" "page") "Section" "" }}
{{ $nav_pages := union $pages $sections }}
{{ range sort $nav_pages "LinkTitle" }}
<li class="nav-item">
<a href="{{ .Permalink }}" class="nav-link">
<code>~/{{ urlize .LinkTitle }}</code>
</a>
</li>
{{ end }}
{{ end }}