summaryrefslogtreecommitdiff
path: root/layouts/_default
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-03-16 08:36:34 +0800
committerEltrac <hi@guhub.cn>2025-03-16 08:36:34 +0800
commit160d37fce48501da2ce75a6988695752fd175e6d (patch)
tree9117a7b8df8231292444330654d5617d7dbcf2b4 /layouts/_default
parent1cdfc37990a076499dfce4bf0f90d7006da62275 (diff)
chore: move tocbot to local
Former-commit-id: a656f32b3f41bd7eaec627b95429ebd3b6441c1f
Diffstat (limited to 'layouts/_default')
-rw-r--r--layouts/_default/single.html11
1 files changed, 11 insertions, 0 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 243f8549..3be45f40 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -59,5 +59,16 @@
{{ partial "components/comment.html" . }}
+ <script src="/js/tocbot.min.js"></script>
+ <script>
+ tocbot.init({
+ tocSelector: '#toc',
+ contentSelector: '#post-content',
+ headingSelector: 'h2, h3:not(blockquote > h3)',
+ hasInnerContainers: true,
+ scrollSmoothOffset: -30
+ });
+ </script>
+
</article>
{{ partial "snippets/document-end.html" . }}