Show static pages in navbar
This commit is contained in:
parent
4793a2abdd
commit
8af06a4c55
1 changed files with 5 additions and 3 deletions
|
@ -1,11 +1,13 @@
|
||||||
{{ $home := .Site.GetPage "home" }}
|
{{ $home := .Site.GetPage "home" }}
|
||||||
|
|
||||||
{{ range where .Site.Pages.ByTitle "Kind" "section" }}
|
{{ $sections := where (where .Site.Pages.ByTitle "Kind" "section") "Parent.UniqueID" $home.UniqueID }}
|
||||||
{{ if eq .Parent $home }}
|
{{ $pages := where (where .Site.Pages.ByTitle "Kind" "page") "Section" "" }}
|
||||||
|
{{ $nav_pages := union $pages $sections }}
|
||||||
|
|
||||||
|
{{ range sort $nav_pages "LinkTitle" }}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="{{ .Permalink }}" class="nav-link">
|
<a href="{{ .Permalink }}" class="nav-link">
|
||||||
<code>~/{{ urlize .LinkTitle }}</code>
|
<code>~/{{ urlize .LinkTitle }}</code>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in a new issue