From 81948de2a4eb059526963087cf5efc65c75532a2 Mon Sep 17 00:00:00 2001 From: Frank Grimm Date: Thu, 14 Nov 2019 05:35:40 +0100 Subject: Added identification of current navigation menu item based on the page identifier (#12) --- layouts/partials/nav.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index 675b466..53ceb21 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -6,6 +6,7 @@ {{ $active := "" }} {{ if eq $showActiveNav true }} {{ $isMenu := or ($currentPage.IsMenuCurrent "nav" .) ($currentPage.HasMenuCurrent "nav" .) }} + {{ $isMenu = or $isMenu (eq $currentPage.Params.identifier .Identifier) }} {{ $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")) }} @@ -18,4 +19,4 @@ {{ $text }} {{ end }} - \ No newline at end of file + -- cgit v1.2.3