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

40 lines
1.6 KiB
HTML

<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 }}
{{ $valid_children := where .Site.Pages.ByTitle ".Parent" "!=" nil }}
{{ $children := where $valid_children ".Parent.UniqueID" .UniqueID }}
<li class="top-level">
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
{{ 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>
</li>
{{ end }}
{{ if ge (len $children) .Site.Params.nav_items }}
<li><a href="{{ .Permalink }}"><i>See more</i></a></li>
{{ end }}
</ul>
{{ end }}
</li>
{{ end }}
{{ end }}
{{ range where .Site.Pages.ByTitle "Kind" "page" }}
{{ if eq .Section "" }}
<li class="top-level"><a href="{{ .Permalink }}">{{ title .LinkTitle }}</a></li>
{{ end }}
{{ end }}
</ul>
</nav>
</header>