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 $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">
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a> {{ partial "navbar/link-item.html" . }}
{{ if $children }} {{ if $children }}
<ul> <ul>
{{ range first .Site.Params.nav_items $children }} {{ range first .Site.Params.nav_items $children }}
<li> <li>
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a> {{ partial "navbar/link-item.html" . }}
<ul> <ul>{{ range .Pages }}<li>{{ partial "navbar/link-item.html" . }}</li>{{ end }}</ul>
{{ range .Pages }}
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
{{ end }}
</ul>
</li> </li>
{{ end }} {{ end }}
{{ if ge (len $children) .Site.Params.nav_items }} {{ if ge (len $children) .Site.Params.nav_items }}
@ -33,9 +29,7 @@
{{ end }} {{ end }}
{{ range where .Site.Pages.ByTitle "Kind" "page" }} {{ range where .Site.Pages.ByTitle "Kind" "page" }}
{{ if eq .Section "" }} {{ if eq .Section "" }}<li class="top-level">{{ partial "navbar/link-item.html" . }}</li>{{ end }}
<li class="top-level"><a href="{{ .Permalink }}">{{ title .LinkTitle }}</a></li>
{{ end }}
{{ end }} {{ end }}
<li class="top-level"><a class="show-mobile" href="/">Home</a></li> <li class="top-level"><a class="show-mobile" href="/">Home</a></li>
</ul> </ul>

View file

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

View file

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