Skip to content

Commit

Permalink
feat(posts): render heading 4 in TOC (#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed Sep 3, 2023
1 parent c4af753 commit 229c2a2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions _javascript/modules/components/toc.js
Original file line number Diff line number Diff line change
@@ -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
});
Expand Down
2 changes: 1 addition & 1 deletion _posts/2019-08-08-text-and-typography.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 1 addition & 3 deletions _sass/layout/post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,7 @@ h1 + .post-meta {
}

ul {
a {
padding-left: 2rem;
}
padding-left: 0.75rem;
}
}
}
Expand Down

0 comments on commit 229c2a2

Please sign in to comment.