From 017acc9fe5fa862a95b5386fd7e46c62387d442b Mon Sep 17 00:00:00 2001 From: Gnanesh Date: Sat, 11 May 2024 16:12:14 +0530 Subject: [PATCH] Add ability to toggle menu entries --- layouts/partials/docs-nav.html | 37 +++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/layouts/partials/docs-nav.html b/layouts/partials/docs-nav.html index 11037fac5..cedc6e3e0 100644 --- a/layouts/partials/docs-nav.html +++ b/layouts/partials/docs-nav.html @@ -6,26 +6,49 @@ {{ $isActive := eq $page . -}} {{ $isActivePath := $page.IsDescendant . -}} {{ $childPages := (union .Pages .Sections).ByWeight -}} -
  • - +
  • + {{ if gt (len $childPages) 0 }} {{ if or $isActive $isActivePath -}} - + {{ else -}} - + {{ end -}} {{ end -}} - {{.LinkTitle}} + {{.LinkTitle}}
  • - {{ if and (gt (len $childPages) 0) (or $isActive $isActivePath)}} -