diff options
author | Simon <gevhaz@tutanota.com> | 2020-06-09 01:30:46 +0300 |
---|---|---|
committer | Simon <gevhaz@tutanota.com> | 2020-06-09 01:30:46 +0300 |
commit | a618312abd51d0317d14c4f21d1ddeb1211a0ee3 (patch) | |
tree | ded3248a2083719c3cd4b0b78f30d3ef3a1fca5c | |
parent | a30c09b23e0f40cd1c57ec88c6d1a1b786e8f202 (diff) |
Fixed menu highlighting edge case and removed unecessary checks
-rw-r--r-- | layouts/partials/header.html | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 48b7154..8abd754 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -48,22 +48,14 @@ </li> {{- else -}} {{- $currentMenusPage := .Page }} - {{- $currentPageIsTaxonomy := or (eq $currentPage.Kind "taxonomyTerm") (eq $currentPage.Kind "taxonomy") }} {{- $currentMenuInMainSections := false }} {{- with $currentMenusPage }} {{- $currentMenuInMainSections = in site.Params.mainSections .Type }} {{- end }} {{- $active := eq $currentMenusPage $currentPagesParent }} - {{- with $currentMenusPage }} - {{- $active = and $active (ne $currentMenusPage.IsHome true) }} - {{- end }} - {{ with $currentPage.File }} - {{- $active = and $active (ne .Dir "{{ .Site.BaseURL }}" ) }} - {{ end }} + {{- $active = and $active (eq $currentPage.RelPermalink .URL ) }} {{- $active = or $active (eq $currentPage.Title .Name ) }} - {{- $active = or $active (eq $currentPage.RelPermalink .URL ) }} - {{- $active = or $active (and $currentPageIsTaxonomy $currentMenuInMainSections) }} {{- $active = or $active ($currentPage.IsMenuCurrent "main" . ) }} <li class="{{- if $active -}} activetab {{- end -}}"> <a href="{{ .URL }}"> |