35 lines
1.3 KiB
HTML
35 lines
1.3 KiB
HTML
|
{{ $valid_children := where (where .Site.Pages ".Parent" "!=" nil) ".Params.hide_in_nav" "!=" "true" }}
|
||
|
|
||
|
{{ $home := .Site.GetPage "home" }}
|
||
|
{{ range where .Site.Pages.ByTitle "Kind" "section" }}
|
||
|
{{ if eq .Parent $home }}
|
||
|
{{ $sorted_pages := sort $valid_children (default "Title" .Params.sort_by) (default "asc" .Params.sort_order)}}
|
||
|
{{ $children := where $sorted_pages ".Parent.UniqueID" .UniqueID }}
|
||
|
<li class="top-level">
|
||
|
{{ partial "navbar/link-item.html" . }}
|
||
|
{{ if $children }}
|
||
|
<ul>
|
||
|
{{ range first .Site.Params.nav_items $children }}
|
||
|
<li>
|
||
|
{{ partial "navbar/link-item.html" . }}
|
||
|
{{ $children := where $sorted_pages ".Parent.UniqueID" .UniqueID }}
|
||
|
{{ if $children }}
|
||
|
<ul>
|
||
|
{{ range first .Site.Params.nav_items $children }}<li>{{ partial "navbar/link-item.html" . }}</li>{{ end }}
|
||
|
{{ if ge (len $children) .Site.Params.nav_items }}
|
||
|
<li><a href="{{ .Permalink }}"><i>See more</i></a></li>
|
||
|
{{ end }}
|
||
|
</ul>
|
||
|
{{ end }}
|
||
|
</li>
|
||
|
{{ end }}
|
||
|
|
||
|
{{ if ge (len $children) .Site.Params.nav_items }}
|
||
|
<li><a href="{{ .Permalink }}"><i>See more</i></a></li>
|
||
|
{{ end }}
|
||
|
</ul>
|
||
|
{{ end }}
|
||
|
</li>
|
||
|
{{ end }}
|
||
|
{{ end }}
|