I have a Jekyll website that uses kramdown for markdowns. In _config.yml , I have the following parameter, which ensures that only the <h2> and <h3> elements are displayed in the automatically generated table of contents:
kramdown: toc_levels: "2,3"
This works fine, but on some pages I would like to include the <h4> elements in the TOC, while preserving the existing configuration of <h2> and <h3> on other pages. Is it possible?
On any page, I can access _config.yml definitions as follows:
{{ site.kramdown.toc_levels }}
Is there a way to set the toc_levels value on the page?
jekyll liquid kramdown
Shailen tuli
source share