mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-25 00:53:31 +00:00
feat: change TOC plugin to tocbot (#774)
This commit is contained in:
11
_javascript/modules/components/toc.js
Normal file
11
_javascript/modules/components/toc.js
Normal file
@@ -0,0 +1,11 @@
|
||||
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
|
||||
});
|
||||
}
|
||||
@@ -4,3 +4,4 @@ export { imgExtra } from './components/img-extra';
|
||||
export { initLocaleDatetime } from './components/locale-datetime';
|
||||
export { initPageviews } from './components/pageviews';
|
||||
export { smoothScroll } from './components/smooth-scroll';
|
||||
export { toc } from './components/toc';
|
||||
|
||||
Reference in New Issue
Block a user