1
Fork 0
theorangeone.net-legacy/layouts/partials/navbar/index.html

38 lines
1.6 KiB
HTML
Raw Normal View History

2017-07-24 09:19:35 +01:00
<header id="header" {{ if .IsHome }}class="alt"{{ end }}>
<h1><a href="/" class="navbar-brand">{{ title .Site.Title }}</a></h1>
<nav id="nav">
<ul>
{{ $home := .Site.GetPage "home" }}
{{ range where .Site.Pages.ByTitle "Kind" "section" }}
{{ if eq .Parent $home }}
2017-09-15 08:49:59 +01:00
{{ $sorted_pages := sort .Site.Pages (default "Title" .Params.sort_by) (default "asc" .Params.sort_order)}}
{{ $valid_children := where $sorted_pages ".Parent" "!=" nil }}
2017-07-24 09:19:35 +01:00
{{ $children := where $valid_children ".Parent.UniqueID" .UniqueID }}
{{ $children := where $children ".Params.hide_in_nav" "!=" "true" }}
<li class="top-level">
2017-09-16 20:15:00 +01:00
{{ partial "navbar/link-item.html" . }}
2017-07-24 09:19:35 +01:00
{{ if $children }}
<ul>
{{ range first .Site.Params.nav_items $children }}
<li>
2017-09-16 20:15:00 +01:00
{{ partial "navbar/link-item.html" . }}
<ul>{{ range .Pages }}<li>{{ partial "navbar/link-item.html" . }}</li>{{ end }}</ul>
2017-07-24 09:19:35 +01:00
</li>
{{ end }}
{{ if ge (len $children) .Site.Params.nav_items }}
<li><a href="{{ .Permalink }}"><i>See more</i></a></li>
{{ end }}
</ul>
{{ end }}
</li>
2017-04-22 23:24:13 +01:00
{{ end }}
2017-07-24 09:19:35 +01:00
{{ end }}
2017-04-23 11:40:15 +01:00
2017-07-24 09:19:35 +01:00
{{ range where .Site.Pages.ByTitle "Kind" "page" }}
2017-09-16 20:15:00 +01:00
{{ if eq .Section "" }}<li class="top-level">{{ partial "navbar/link-item.html" . }}</li>{{ end }}
2017-07-24 09:19:35 +01:00
{{ end }}
<li class="top-level"><a class="show-mobile" href="/">Home</a></li>
</ul>
</nav>
</header>