fix(deps): `tocbot` has no initialization detection (#957)
Resolves #957
This commit is contained in:
parent
8b4f99c87f
commit
8225174cb5
|
@ -1,11 +1,13 @@
|
|||
export function toc() {
|
||||
// see: https://github.com/tscanlin/tocbot#usage
|
||||
tocbot.init({
|
||||
tocSelector: '#toc',
|
||||
contentSelector: '.post-content',
|
||||
ignoreSelector: '[data-toc-skip]',
|
||||
headingSelector: 'h2, h3',
|
||||
orderedList: false,
|
||||
scrollSmooth: false
|
||||
});
|
||||
if (document.querySelector('#core-wrapper h2,#core-wrapper h3')) {
|
||||
// see: https://github.com/tscanlin/tocbot#usage
|
||||
tocbot.init({
|
||||
tocSelector: '#toc',
|
||||
contentSelector: '.post-content',
|
||||
ignoreSelector: '[data-toc-skip]',
|
||||
headingSelector: 'h2, h3',
|
||||
orderedList: false,
|
||||
scrollSmooth: false
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue