From 214cb7994fa79413b178f1fc50ce373a1b1f202b Mon Sep 17 00:00:00 2001 From: Xin Date: Sat, 21 Oct 2023 23:18:42 +0100 Subject: [PATCH] perf: cache sidebear-collapsible-button --- layouts/partials/sidebar.html | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 4420c71..1f8262f 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -150,19 +150,13 @@ > {{- .title -}} {{- with .context }} - {{- if or .RegularPages .Sections }} - - {{- template "sidebear-collapsible-button" -}} - - {{- end }} + {{- if or .RegularPages .Sections }}{{ partialCached "sidebear-collapsible-button" . }}{{ end -}} {{ end -}} {{- end -}} -{{- define "sidebar-separator" -}} -
-{{- end -}} - -{{- define "sidebear-collapsible-button" -}} - +{{- define "partials/sidebear-collapsible-button" -}} + + + {{- end -}}