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" }}
|
||||
|
||||
{{ 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 }}
|
||||
|
|
Loading…
Reference in a new issue