web/_javascript/modules/components/toc.js

14 lines
358 B
JavaScript
Raw Normal View History

export function toc() {
if (document.querySelector('#core-wrapper h2')) {
// see: https://github.com/tscanlin/tocbot#usage
tocbot.init({
tocSelector: '#toc',
contentSelector: '.post-content',
ignoreSelector: '[data-toc-skip]',
headingSelector: 'h2, h3, h4',
orderedList: false,
scrollSmooth: false
});
}
}