Skip to content
Snippets Groups Projects
Commit ea433bad authored by Sietze van Buuren's avatar Sietze van Buuren Committed by Emanuele Aina
Browse files

Enable optional custom nav menu page ordering

parent a36422a7
No related branches found
No related tags found
1 merge request!382Enable optional custom nav menu page ordering
Pipeline #336639 passed with warnings
......@@ -213,16 +213,24 @@
</li>
{{ end }}
-->
{{ $currentPage := . }}
{{ range .Pages.ByWeight }}
{{ if and (lt .Params.weight 100) (ne .Params.weight nil) }}
{{ partial "nav_page_item.html" ( dict "dot" . "currentPage" $.Page.RelPermalink ) }}
{{end}}
{{end}}
{{ range .Pages.ByTitle }}
<li class="sidebar-page">
<a href="{{ .Permalink | relLangURL }}"
{{ if eq $.Page.RelPermalink .RelPermalink }}id="sidebar-page-focus" class="sidebar-page-focus"{{end}}>
{{ .Name }}</a>
</li>
{{ end }}
{{ if or (eq .Params.weight 100) (eq .Params.weight nil) }}
{{ partial "nav_page_item.html" ( dict "dot" . "currentPage" $.Page.RelPermalink ) }}
{{end}}
{{end}}
{{ range .Pages.ByWeight }}
{{ if gt .Params.weight 100 }}
{{ partial "nav_page_item.html" ( dict "dot" . "currentPage" $.Page.RelPermalink ) }}
{{end}}
{{end}}
</ul>
</div>
......
<li class="sidebar-page">
<a href="{{ .dot.Permalink | relLangURL }}" {{ if eq .currentPage .dot.RelPermalink }}id="sidebar-page-focus" class="sidebar-page-focus"{{end}}>
{{ .dot.Name }}
</a>
</li>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment