feat(posts): render heading 4 in TOC (#1023)

This commit is contained in:
Cotes Chung 2023-09-03 20:20:14 +08:00
parent c4af75389a
commit 229c2a2e2b
No known key found for this signature in database
GPG key ID: 0D9E54843167A808
3 changed files with 4 additions and 6 deletions

View file

@ -1,11 +1,11 @@
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
tocbot.init({
tocSelector: '#toc',
contentSelector: '.post-content',
ignoreSelector: '[data-toc-skip]',
headingSelector: 'h2, h3',
headingSelector: 'h2, h3, h4',
orderedList: false,
scrollSmooth: false
});

View file

@ -23,7 +23,7 @@ This post is to show Markdown syntax rendering on [**Chirpy**](https://github.co
<h3 data-toc-skip>H3 - heading</h3>
<h4>H4 - heading</h4>
<h4 data-toc-skip>H4 - heading</h4>
## Paragraph

View file

@ -314,9 +314,7 @@ h1 + .post-meta {
}
ul {
a {
padding-left: 2rem;
}
padding-left: 0.75rem;
}
}
}