diff --git a/layouts/_partials/sidebar-tree.html b/layouts/_partials/sidebar-tree.html
index dba63f3a..e5f00807 100644
--- a/layouts/_partials/sidebar-tree.html
+++ b/layouts/_partials/sidebar-tree.html
@@ -1,37 +1,57 @@
{{- /*
- A modified version of the siderbar-tree.html partial in Docsy, adding:
-
- * The "toc.html" partial at L45.
+ A copy of the siderbar-tree.html partial in Docsy, modified to:
+
+ * Ignore the `sidebarRoot` parameter, because of this regression:
+
+ * Add the "toc.html" partial at L68.
*/ -}}
-{{/* We cache this partial for bigger sites and set the active class client side. */ -}}
-{{ $sidebarCacheLimit := .Site.Params.ui.sidebar_cache_limit | default 2000 -}}
-{{ $shouldDelayActive := ge (len .Site.Pages) $sidebarCacheLimit -}}
+{{ $context := .context -}}
+{{ $sidebarRoot := .sidebarRoot -}}
+{{ $sidebarRootID := .sidebarRootID -}}
+{{ $cacheSidebar := .cacheSidebar -}}
+
+{{ with $context -}}
+{{/* When the sidebar is cached, "active" class is set client side. */ -}}
+{{ $shouldDelayActive := $cacheSidebar -}}
+