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 dd46994e97d..9f938246706 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 27709964929..591dbcb6486 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