Replies: 3 comments 4 replies
-
@opabravo In case of Create a file !function(){
"use strict";
document.querySelector("main h2, main h3")&&tocbot.init({
tocSelector:"#toc",
contentSelector:".content",
ignoreSelector:"[data-toc-skip]",
headingSelector:"h2, h3, h4, h5, h6",
orderedList:!1,
scrollSmooth:!1
})}(); Since custom scripts are being executed later, it overrides configuration successfully. However, I'm not sure this will work stable for 100%, but it seems to work. |
Beta Was this translation helpful? Give feedback.
-
Here is the working solution. Create a file <script type="text/javascript" src="/assets/js/toc.js" defer></script> Then, create a javascript file document.querySelector("main h2, main h3")&&tocbot.refresh({
tocSelector:"#toc",
contentSelector:".content",
ignoreSelector:"[data-toc-skip]",
headingSelector:"h2, h3, h4, h5, h6",
orderedList:!1,
scrollSmooth:!1,
collapseDepth: 6
}); Here is tocbot documentation regarding available options. FYI @huanyushi @opabravo |
Beta Was this translation helpful? Give feedback.
-
Checklist
How did you create the site?
Generated from
chirpy-starter
Description
Is there a way to enable all h2~h6 headeres in TOC section?
Operations you have already tried
Anything else?
No response
Beta Was this translation helpful? Give feedback.
All reactions