feat(posts): render heading 4 in TOC (#1023)
This commit is contained in:
parent
c4af75389a
commit
229c2a2e2b
3 changed files with 4 additions and 6 deletions
|
@ -1,11 +1,11 @@
|
||||||
export function toc() {
|
export function toc() {
|
||||||
if (document.querySelector('#core-wrapper h2,#core-wrapper h3')) {
|
if (document.querySelector('#core-wrapper h2')) {
|
||||||
// see: https://github.com/tscanlin/tocbot#usage
|
// see: https://github.com/tscanlin/tocbot#usage
|
||||||
tocbot.init({
|
tocbot.init({
|
||||||
tocSelector: '#toc',
|
tocSelector: '#toc',
|
||||||
contentSelector: '.post-content',
|
contentSelector: '.post-content',
|
||||||
ignoreSelector: '[data-toc-skip]',
|
ignoreSelector: '[data-toc-skip]',
|
||||||
headingSelector: 'h2, h3',
|
headingSelector: 'h2, h3, h4',
|
||||||
orderedList: false,
|
orderedList: false,
|
||||||
scrollSmooth: false
|
scrollSmooth: false
|
||||||
});
|
});
|
||||||
|
|
|
@ -23,7 +23,7 @@ This post is to show Markdown syntax rendering on [**Chirpy**](https://github.co
|
||||||
|
|
||||||
<h3 data-toc-skip>H3 - heading</h3>
|
<h3 data-toc-skip>H3 - heading</h3>
|
||||||
|
|
||||||
<h4>H4 - heading</h4>
|
<h4 data-toc-skip>H4 - heading</h4>
|
||||||
|
|
||||||
## Paragraph
|
## Paragraph
|
||||||
|
|
||||||
|
|
|
@ -314,9 +314,7 @@ h1 + .post-meta {
|
||||||
}
|
}
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
a {
|
padding-left: 0.75rem;
|
||||||
padding-left: 2rem;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue