1
Fork 0

Split up navbar

This commit is contained in:
Jake Howard 2017-09-16 20:15:00 +01:00
parent 1315051d5f
commit a372b1068b
Signed by: jake
GPG key ID: 57AFB45680EDD477
3 changed files with 6 additions and 11 deletions

View file

@ -10,17 +10,13 @@
{{ $children := where $valid_children ".Parent.UniqueID" .UniqueID }}
{{ $children := where $children ".Params.hide_in_nav" "!=" "true" }}
<li class="top-level">
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
{{ partial "navbar/link-item.html" . }}
{{ if $children }}
<ul>
{{ range first .Site.Params.nav_items $children }}
<li>
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
<ul>
{{ range .Pages }}
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
{{ end }}
</ul>
{{ partial "navbar/link-item.html" . }}
<ul>{{ range .Pages }}<li>{{ partial "navbar/link-item.html" . }}</li>{{ end }}</ul>
</li>
{{ end }}
{{ if ge (len $children) .Site.Params.nav_items }}
@ -33,9 +29,7 @@
{{ end }}
{{ range where .Site.Pages.ByTitle "Kind" "page" }}
{{ if eq .Section "" }}
<li class="top-level"><a href="{{ .Permalink }}">{{ title .LinkTitle }}</a></li>
{{ end }}
{{ if eq .Section "" }}<li class="top-level">{{ partial "navbar/link-item.html" . }}</li>{{ end }}
{{ end }}
<li class="top-level"><a class="show-mobile" href="/">Home</a></li>
</ul>

View file

@ -0,0 +1 @@
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>

View file

@ -7,5 +7,5 @@
{{ else }}
<body>
{{ end }}
{{ partial "navbar.html" . }}
{{ partial "navbar/index.html" . }}
<div id="page-wrapper">