From 241f7defaaed55cc088e7a6a02b8228ae1b58618 Mon Sep 17 00:00:00 2001 From: HOKAGO-MEMORIES Date: Wed, 5 Apr 2023 23:05:34 +0900 Subject: [PATCH] Revert "fix(deps): `tocbot` has no initialization detection (#957)" This reverts commit 8225174cb5e02fda7b3cc548ec821c876b0a5139. --- _javascript/modules/components/toc.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/_javascript/modules/components/toc.js b/_javascript/modules/components/toc.js index bfb0c006f52..ba0415d3ff8 100644 --- a/_javascript/modules/components/toc.js +++ b/_javascript/modules/components/toc.js @@ -1,13 +1,11 @@ export function toc() { - if (document.querySelector('main h2')) { - // see: https://github.com/tscanlin/tocbot#usage - tocbot.init({ - tocSelector: '#toc', - contentSelector: '.content', - ignoreSelector: '[data-toc-skip]', - headingSelector: 'h2, h3, h4', - orderedList: false, - scrollSmooth: false - }); - } + // see: https://github.com/tscanlin/tocbot#usage + tocbot.init({ + tocSelector: '#toc', + contentSelector: '.post-content', + ignoreSelector: '[data-toc-skip]', + headingSelector: 'h2, h3', + orderedList: false, + scrollSmooth: false + }); }