summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/single.html11
-rw-r--r--layouts/partials/scripts.html12
2 files changed, 11 insertions, 12 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" . }}
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html
index fbd7c65a..3beda6dd 100644
--- a/layouts/partials/scripts.html
+++ b/layouts/partials/scripts.html
@@ -10,18 +10,6 @@ lazyLoadInstance.update();
/* === Fancybox === */
Fancybox.bind("[data-fancybox]");
-/* === tocbot === */
-function loadToc() {
- tocbot.init({
- tocSelector: '#toc',
- contentSelector: '#post-content',
- headingSelector: 'h2, h3:not(blockquote > h3)',
- hasInnerContainers: true,
- scrollSmoothOffset: -30
- });
-}
-loadToc();
-
/* === littlefoot === */
littlefoot.littlefoot(littlefootOptions)
</script>