1
Fork 0

Allow sorting in navbar dropdowns too

This commit is contained in:
Jake Howard 2017-09-15 08:49:59 +01:00
parent a617ad961c
commit 5c84bc0f20
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -5,7 +5,8 @@
{{ $home := .Site.GetPage "home" }} {{ $home := .Site.GetPage "home" }}
{{ range where .Site.Pages.ByTitle "Kind" "section" }} {{ range where .Site.Pages.ByTitle "Kind" "section" }}
{{ if eq .Parent $home }} {{ if eq .Parent $home }}
{{ $valid_children := where .Site.Pages.ByTitle ".Parent" "!=" nil }} {{ $sorted_pages := sort .Site.Pages (default "Title" .Params.sort_by) (default "asc" .Params.sort_order)}}
{{ $valid_children := where $sorted_pages ".Parent" "!=" nil }}
{{ $children := where $valid_children ".Parent.UniqueID" .UniqueID }} {{ $children := where $valid_children ".Parent.UniqueID" .UniqueID }}
{{ $children := where $children ".Params.hide_in_nav" "!=" "true" }} {{ $children := where $children ".Params.hide_in_nav" "!=" "true" }}
<li class="top-level"> <li class="top-level">