1
Fork 0

Remove navbar dropdowns

This commit is contained in:
Jake Howard 2017-11-09 13:30:33 +00:00
parent 4651db86a2
commit 819ab6991a
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 4 additions and 26 deletions

View file

@ -1,24 +1,11 @@
{{ $valid_children := where (where .Site.Pages ".Parent" "!=" nil) ".Params.hide_in_nav" "!=" "true" }}
{{ $home := .Site.GetPage "home" }}
{{ range where .Site.Pages.ByTitle "Kind" "section" }}
{{ if eq .Parent $home }}
{{ $sorted_pages := sort $valid_children (default "Title" .Params.sort_by) (default "asc" .Params.sort_order)}}
{{ $children := where $sorted_pages ".Parent.UniqueID" .UniqueID }}
<li class="nav-item{{ if $children }} dropdown{{ end }}">
<a href="{{ .Permalink }}" class="nav-link{{ if $children }}{{ end }}"{{ if $children }} data-toggle="dropdown"{{ end }}><code>~/{{ .LinkTitle }}</code></a>
{{ if $children }}
<div class="dropdown-menu">
{{ range first .Site.Params.nav_items $children }}
<a class="dropdown-item" href="{{ .Permalink }}"><code>{{ .LinkTitle }}</code></a>
{{ end }}
{{ if ge (len $children) .Site.Params.nav_items }}
<div class="dropdown-divider"></div>
<a class="dropdown-item font-italic" href="{{ .Permalink }}"><code>See More</code></a>
{{ end }}
</div>
{{ end }}
<li class="nav-item">
<a href="{{ .Permalink }}" class="nav-link">
<code>~/{{ urlize .LinkTitle }}</code>
</a>
</li>
{{ end }}
{{ end }}

View file

@ -174,12 +174,3 @@ pre.chroma {
background-color: #272822;
}
}
.dropdown-menu {
min-width: initial;
padding: $spacer * 0.25 0;
.dropdown-item {
padding: $spacer * 0.25 $spacer;
}
}