From 22f1890a9beab11d8cfdceba3a4d66f8bbbb468c Mon Sep 17 00:00:00 2001 From: Ian Lewis Date: Fri, 29 Mar 2019 22:40:11 -0400 Subject: Initial commit --- themes/docsy/layouts/partials/sidebar.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 themes/docsy/layouts/partials/sidebar.html (limited to 'themes/docsy/layouts/partials/sidebar.html') diff --git a/themes/docsy/layouts/partials/sidebar.html b/themes/docsy/layouts/partials/sidebar.html new file mode 100644 index 000000000..bf568e210 --- /dev/null +++ b/themes/docsy/layouts/partials/sidebar.html @@ -0,0 +1,14 @@ +{{/* The "active" toggle here may delay rendering, so we only cache this side bar menu for bigger sites. */}} +{{ $shouldCache := ge (len .Site.Pages) 2000 }} +{{ if $shouldCache }} +{{ $mid := printf "m-%s" (.RelPermalink | anchorize) }} + +{{ partialCached "sidebar-tree.html" . .CurrentSection.RelPermalink }} +{{ else }} +{{ partial "sidebar-tree.html" . }} +{{ end }} -- cgit v1.2.3