From 229c2a2e2b109fc2eca85be548f1dd97234e44c4 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sun, 3 Sep 2023 20:20:14 +0800 Subject: [PATCH] feat(posts): render heading 4 in TOC (#1023) --- _javascript/modules/components/toc.js | 4 ++-- _posts/2019-08-08-text-and-typography.md | 2 +- _sass/layout/post.scss | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/_javascript/modules/components/toc.js b/_javascript/modules/components/toc.js index dd46994..9f93824 100644 --- a/_javascript/modules/components/toc.js +++ b/_javascript/modules/components/toc.js @@ -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 }); diff --git a/_posts/2019-08-08-text-and-typography.md b/_posts/2019-08-08-text-and-typography.md index 2770996..591dbcb 100644 --- a/_posts/2019-08-08-text-and-typography.md +++ b/_posts/2019-08-08-text-and-typography.md @@ -23,7 +23,7 @@ This post is to show Markdown syntax rendering on [**Chirpy**](https://github.co

H3 - heading

-

H4 - heading

+

H4 - heading

## Paragraph diff --git a/_sass/layout/post.scss b/_sass/layout/post.scss index 15ea607..615215e 100644 --- a/_sass/layout/post.scss +++ b/_sass/layout/post.scss @@ -314,9 +314,7 @@ h1 + .post-meta { } ul { - a { - padding-left: 2rem; - } + padding-left: 0.75rem; } } }