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

github.com/zwbetz-gh/vanilla-bootstrap-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Betz <zwbetz@gmail.com>2019-02-13 21:50:00 +0300
committerZachary Betz <zwbetz@gmail.com>2019-02-13 21:50:00 +0300
commit16a40bc9e72c14796ddfa90eb77d5ab90a122277 (patch)
tree0263857a7ea1f1c55bf4f98a7481acee3a748be7
parent031c5ff221a1c1a7ff393fea1aa8c18d1edfcea7 (diff)
Fix active menu for Blog and Tags
-rw-r--r--layouts/partials/nav.html5
1 files changed, 4 insertions, 1 deletions
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html
index 95699c8..675b466 100644
--- a/layouts/partials/nav.html
+++ b/layouts/partials/nav.html
@@ -6,7 +6,10 @@
{{ $active := "" }}
{{ if eq $showActiveNav true }}
{{ $isMenu := or ($currentPage.IsMenuCurrent "nav" .) ($currentPage.HasMenuCurrent "nav" .) }}
- {{ if or $isMenu (eq $currentPage.Title .Name) }}
+ {{ $isMenu = or $isMenu (eq $currentPage.Title .Name) }}
+ {{ $isMenu = or $isMenu (and (eq .Name "Blog") (eq $currentPage.Section "post")) }}
+ {{ $isMenu = or $isMenu (and (eq .Name "Tags") (eq $currentPage.Section "tags")) }}
+ {{ if $isMenu }}
{{ $active = "nav-link-active" }}
{{ end }}
{{ end }}