From c7e3a147ddfd2001716bf36cda9fb56fd41dbf39 Mon Sep 17 00:00:00 2001 From: Aaron Crawfis Date: Wed, 5 Jul 2023 13:13:00 -0700 Subject: [PATCH] Add dropdown arrows to sections --- docs/assets/scss/_sidebar-tree.scss | 1 - docs/config.toml | 1 + docs/layouts/partials/sidebar-tree.html | 71 ------------------------- 3 files changed, 1 insertion(+), 72 deletions(-) delete mode 100644 docs/layouts/partials/sidebar-tree.html diff --git a/docs/assets/scss/_sidebar-tree.scss b/docs/assets/scss/_sidebar-tree.scss index a8f9bb568..8a4dfb840 100644 --- a/docs/assets/scss/_sidebar-tree.scss +++ b/docs/assets/scss/_sidebar-tree.scss @@ -58,7 +58,6 @@ &__page { color: $gray-700; - font-weight: $font-weight-light; } } diff --git a/docs/config.toml b/docs/config.toml index c30d4c567..8142ae7e2 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -93,4 +93,5 @@ version_menu = "Releases" [params.ui] sidebar_menu_compact = true sidebar_search_disable = true +sidebar_menu_foldable = true ul_show = 1 diff --git a/docs/layouts/partials/sidebar-tree.html b/docs/layouts/partials/sidebar-tree.html deleted file mode 100644 index 3b33f9059..000000000 --- a/docs/layouts/partials/sidebar-tree.html +++ /dev/null @@ -1,71 +0,0 @@ -{{/* 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 -}} -
- {{ if not .Site.Params.ui.sidebar_search_disable -}} - - {{ else -}} -
- -
-
- {{ end -}} - -
-{{ 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) ($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 -}} -
  • - {{ if (and $p.Site.Params.ui.sidebar_menu_foldable (ge $ulNr 1)) -}} - - - {{ else -}} - {{ with $s.Params.Icon}}{{ end }}{{ $s.LinkTitle }} - {{- end }} - {{- if $withChild }} - {{- $ulNr := add $ulNr 1 }} - - {{- end }} -
  • -{{- end }} \ No newline at end of file