diff options
author | Zachary Betz <zwbetz@gmail.com> | 2019-02-13 21:50:00 +0300 |
---|---|---|
committer | Zachary Betz <zwbetz@gmail.com> | 2019-02-13 21:50:00 +0300 |
commit | 16a40bc9e72c14796ddfa90eb77d5ab90a122277 (patch) | |
tree | 0263857a7ea1f1c55bf4f98a7481acee3a748be7 | |
parent | 031c5ff221a1c1a7ff393fea1aa8c18d1edfcea7 (diff) |
Fix active menu for Blog and Tags
-rw-r--r-- | layouts/partials/nav.html | 5 |
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 }} |