Front-Matters
There are lots of TOC related params. You can not only set it in the params.toml
file but also in the markdown file. If you set the TOC related params in params.toml
file, it will be the global settings. If you set it in the front-matter, it will be the post-specific settings.
|
|
Check out the toc related params documentation to see what it is.
config.toml
There are some toc
related params in the config.toml
file.
|
|
You need to set this configuration parameter. Otherwise toc
will malfunction. startLevel
and endLevel
means that you use at maximum h2
tag , and at minimum, h3
tag for the title of the post. And h1, h4, h5, h6 tags are not going to be included in your TOC element.
Some posts may have h2 tags and some posts may not. For that reason, I made tocLevels
front-matter. So, it’s best practice to use todLevels
in every markdown file if you want to include TOC in your post.
|
|
params.toml
You can set the toc related params at params.toml
file for the global.
- hideToc - Hide the toc in the first place. You can toggle the switch to show the toc later .
- enableToc - Toc disapear entirely in all posts.
- toc - Toc disapear entirely in all posts. This is Alias to
enableToc
- enableTocContent - Toc in the main article, not in sidebar.
- tocPosition: When
inner
, toc will be inside the border. Whenouter
, toc will be outside of the border