Split up navbar
This commit is contained in:
parent
1315051d5f
commit
a372b1068b
3 changed files with 6 additions and 11 deletions
|
@ -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>
|
1
layouts/partials/navbar/link-item.html
Normal file
1
layouts/partials/navbar/link-item.html
Normal file
|
@ -0,0 +1 @@
|
|||
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
|
|
@ -7,5 +7,5 @@
|
|||
{{ else }}
|
||||
<body>
|
||||
{{ end }}
|
||||
{{ partial "navbar.html" . }}
|
||||
{{ partial "navbar/index.html" . }}
|
||||
<div id="page-wrapper">
|
||||
|
|
Loading…
Reference in a new issue