summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorReorx <novoreorx@gmail.com>2022-04-14 17:45:57 +0800
committerReorx <novoreorx@gmail.com>2022-04-14 17:47:01 +0800
commite91423d6f2803efb006d539386dfcee02387d54b (patch)
tree6be1db12819421225be8380c217f79f48d4ae280 /layouts
parentad52cd9e5153de1131f519ac101dee1c38aef104 (diff)
use partial instead of partialCached for footer.html
footer has involved a lot of config keys since our fork, sometimes the toc scroll behavior is broken due to cached footer is inconsistant with the current file
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/baseof.html2
-rw-r--r--layouts/partials/footer.html2
2 files changed, 3 insertions, 1 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 349910a..5a694e7 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -18,7 +18,7 @@
<main class="main {{- if (eq .Kind `page`) -}}{{- print " post" -}}{{- end -}}">
{{- block "main" . }}{{ end }}
</main>
- {{ partialCached "footer.html" . .Layout .Kind (.Param "hideFooter") (.Param "ShowCodeCopyButtons") -}}
+ {{ partial "footer.html" . -}}
{{- block "body_end" . }}{{ end }}
</body>
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 8e34467..94cc321 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -158,8 +158,10 @@
for (const listener of scrollListeners) {
window.removeEventListener('scroll', listener)
}
+ window.scrollListeners = []
return
}
+ // console.log('enable toc scroll')
const headings = document.querySelectorAll('h1[id],h2[id],h3[id],h4[id],h5[id]');
const activeClass = 'active';