summaryrefslogtreecommitdiff
path: root/layouts/partials/scripts.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/scripts.html')
-rw-r--r--layouts/partials/scripts.html15
1 files changed, 15 insertions, 0 deletions
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html
index 60ef902c..89be5e8d 100644
--- a/layouts/partials/scripts.html
+++ b/layouts/partials/scripts.html
@@ -33,11 +33,26 @@ lazyLoadInstance.update();
/* === Fancybox === */
Fancybox.bind("[data-fancybox]");
+/* === tocbot === */
+function loadToc() {
+ tocbot.init({
+ tocSelector: '#toc',
+ // Where to grab the headings to build the table of contents.
+ contentSelector: '#post-content',
+ // Which headings to grab inside of the contentSelector element.
+ headingSelector: 'h2, h3',
+ // For headings inside relative or absolute positioned containers within content.
+ hasInnerContainers: true,
+ });
+}
+loadToc();
+
/* === swup === */
const swup = new Swup();
swup.hooks.on('page:view', () => {
loadWalineComment();
lazyLoadInstance.update();
Fancybox.bind("[data-fancybox]");
+ loadToc();
});
</script>