From e26ff03d29c2e3647ac35a3908abafecaf74c906 Mon Sep 17 00:00:00 2001 From: seokho-son Date: Mon, 21 Jun 2021 10:10:36 +0900 Subject: [PATCH] Fix sidefar indentation by updating layout --- layouts/partials/sidebar-tree.html | 111 ++++++++++++++++++----------- 1 file changed, 70 insertions(+), 41 deletions(-) diff --git a/layouts/partials/sidebar-tree.html b/layouts/partials/sidebar-tree.html index 4bc83737ae8..37420c55f59 100644 --- a/layouts/partials/sidebar-tree.html +++ b/layouts/partials/sidebar-tree.html @@ -1,5 +1,6 @@ {{/* We cache this partial for bigger sites and set the active class client side. */}} -{{ $shouldDelayActive := ge (len .Site.Pages) 2000 }} +{{ $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 := .delayActive }} -{{ $active := eq $p.CurrentSection $s }} -{{ $show := or (eq $s $p.FirstSection) (and (not $p.Site.Params.ui.sidebar_menu_compact) ($p.IsDescendant $s)) }} -{{ $sid := $s.RelPermalink | anchorize }} - + {{ end }} + {{ end }}