diff options
author | Salim B <salim@posteo.de> | 2019-05-10 16:52:39 +0300 |
---|---|---|
committer | Guillermo Guerrero Ibarra <wolf.fox1985@gmail.com> | 2019-05-10 16:52:39 +0300 |
commit | 1291f437fd8d347c4457c37af26fb2876aa6f545 (patch) | |
tree | 82611fb213fd83a5db0392c9229f1f85735f1856 /layouts/partials | |
parent | 2765194e3b464a4912fd13dd02b736e45542cbb2 (diff) |
improve navigation highlighting: (#211)1.0.0
* improve navigation highlighting:
- highlight blog section when on taxonomy sites (`/tags/` and `/categories/`)
- highlight home, too
* nav highlighting: fall back to `url` if `identifier` key is not set for menu
Diffstat (limited to 'layouts/partials')
-rw-r--r-- | layouts/partials/nav.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index 005ec08..8810c32 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -23,7 +23,7 @@ {{ $current := . }} {{ range .Site.Menus.main }} {{ $topLevel := replace .URL "/" "" }} - <li class="dropdown{{ if not $current.IsHome }}{{ if or (eq $current.RelPermalink .URL) (eq $current.Type $topLevel) }} active{{ end }}{{ end }}"> + <li class="dropdown{{ if eq $current.RelPermalink .URL | or (eq $current.Type $topLevel) | or (and (eq (default (trim .URL "/") .Identifier) "blog") (in (slice "taxonomy" "taxonomyTerm") $current.Kind)) }} active{{ end }}"> {{ if .HasChildren }} <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{ .Name }} <span class="caret"></span></a> <ul class="dropdown-menu"> |