diff --git a/config.toml b/config.toml index 3cf2a50b..c6f1bd45 100644 --- a/config.toml +++ b/config.toml @@ -64,6 +64,8 @@ footer_about_disable = false rendered_data_collapsed = false # Hide the search entry in the sidebar sidebar_search_disable = true +# Only show the current page's ancestors, siblings and direct descendants in the sidebar menu +sidebar_menu_compact = true [params.links] # End user relevant links. These will show up on left side of footer and in the community page if you have one. diff --git a/layouts/partials/sidebar-tree.html b/layouts/partials/sidebar-tree.html deleted file mode 100644 index 03ecacf0..00000000 --- a/layouts/partials/sidebar-tree.html +++ /dev/null @@ -1,82 +0,0 @@ -{{/* - - A version of the sidebar-tree.html partial in Docsy, with a few small - modifications: - - * include `div#toc` for the ToC - -*/}} - -{{/* We cache this partial for bigger sites and set the active class client side. */}} -{{ $sidebarCacheLimit := cond (isset .Site.Params.ui "sidebar_cache_limit") .Site.Params.ui.sidebar_cache_limit 2000 -}} -{{ $shouldDelayActive := ge (len .Site.Pages) $sidebarCacheLimit -}} -
-{{ define "section-tree-nav-section" -}} -{{ $s := .section -}} -{{ $p := .page -}} -{{ $shouldDelayActive := .shouldDelayActive -}} -{{ $sidebarMenuTruncate := .sidebarMenuTruncate -}} -{{ $treeRoot := cond (eq .ulNr 0) true false -}} -{{ $ulNr := .ulNr -}} -{{ $ulShow := .ulShow -}} -{{ $active := and (not $shouldDelayActive) (eq $s $p) -}} -{{ $activePath := and (not $shouldDelayActive) (or (eq $p $s) ($p.IsDescendant $s)) -}} -{{ $show := cond (or (lt $ulNr $ulShow) $activePath (and (not $shouldDelayActive) (eq $s.Parent $p.Parent)) (and (not $shouldDelayActive) (eq $s.Parent $p)) (not $p.Site.Params.ui.sidebar_menu_compact) (and (not $shouldDelayActive) ($p.IsDescendant $s.Parent))) true false -}} -{{ $mid := printf "m-%s" ($s.RelPermalink | anchorize) -}} -{{ $pages_tmp := where (union $s.Pages $s.Sections).ByWeight ".Params.toc_hide" "!=" true -}} -{{ $pages := $pages_tmp | first $sidebarMenuTruncate -}} -{{ $withChild := gt (len $pages) 0 -}} -{{ $manualLink := cond (isset $s.Params "manuallink") $s.Params.manualLink ( cond (isset $s.Params "manuallinkrelref") (relref $s $s.Params.manualLinkRelref) $s.RelPermalink) -}} -{{ $manualLinkTitle := cond (isset $s.Params "manuallinktitle") $s.Params.manualLinkTitle $s.Title -}} -