From dcab9883d653392ed92eb99d1aba98b8ca07946b Mon Sep 17 00:00:00 2001 From: Pete Lumbis Date: Tue, 24 Jan 2023 09:37:47 -0500 Subject: [PATCH] Rework navbar. Simplify code and enable for support for KB and contrib (#267) Signed-off-by: Pete Lumbis Signed-off-by: Pete Lumbis --- .../layouts/partials/docs-sidebar.html | 96 +++++++------------ 1 file changed, 35 insertions(+), 61 deletions(-) diff --git a/themes/geekboot/layouts/partials/docs-sidebar.html b/themes/geekboot/layouts/partials/docs-sidebar.html index 46cf7feb..ee2e229c 100644 --- a/themes/geekboot/layouts/partials/docs-sidebar.html +++ b/themes/geekboot/layouts/partials/docs-sidebar.html @@ -1,67 +1,41 @@ {{ $current := . }} -{{ $version_section := (where .Site.Sections ".Page.Params.version" .Page.Params.version) }} + - -{{ define "sidebar-nav" }} - {{ $id := "" }} - {{ if not .id }} - {{ $id = substr (sha1 .thisPage.Permalink) 0 8 }} - {{ else }} - {{ $id = .id }} - {{ end }} - {{ $isParent := (and (ne .childPages nil) (ne (len .childPages) 0)) }} - {{ $isCurrent := eq .current .thisPage }} - {{ $expand := false }} - {{ if .expand }} - {{ $expand = .expand }} - {{ end }} - {{ if or $isCurrent (eq .thisPage .current.Parent) }} - {{ $expand = true }} - {{ end }} -
- {{ if $isParent }} - - {{ template "sidebar-nav" dict "childPages" .Pages "current" .current "thisPage" . "id" $id "expand" $expand}} - {{ else }} -
-
- {{ $current := .current }} - {{ range .thisPage.childPages }} - - {{ end }} -
-
+ {{ end }} {{ end }} -
-{{ end }} + {{ end }} + \ No newline at end of file