wip(js): add head.html and assets/js
This commit is contained in:
20
assets/js/modules/components/toc/toc-desktop.js
Normal file
20
assets/js/modules/components/toc/toc-desktop.js
Normal file
@ -0,0 +1,20 @@
|
||||
export class TocDesktop {
|
||||
/* Tocbot options Ref: https://github.com/tscanlin/tocbot#usage */
|
||||
static options = {
|
||||
tocSelector: '#toc',
|
||||
contentSelector: '.content',
|
||||
ignoreSelector: '[data-toc-skip]',
|
||||
headingSelector: 'h2, h3, h4',
|
||||
orderedList: false,
|
||||
scrollSmooth: false,
|
||||
headingsOffset: 16 * 2 // 2rem
|
||||
};
|
||||
|
||||
static refresh() {
|
||||
tocbot.refresh(this.options);
|
||||
}
|
||||
|
||||
static init() {
|
||||
tocbot.init(this.options);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user