Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gevhaz/hugo-theme-notrack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon <gevhaz@tutanota.com>2020-06-09 01:30:46 +0300
committerSimon <gevhaz@tutanota.com>2020-06-09 01:30:46 +0300
commita618312abd51d0317d14c4f21d1ddeb1211a0ee3 (patch)
treeded3248a2083719c3cd4b0b78f30d3ef3a1fca5c
parenta30c09b23e0f40cd1c57ec88c6d1a1b786e8f202 (diff)
Fixed menu highlighting edge case and removed unecessary checks
-rw-r--r--layouts/partials/header.html10
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 }}">