Display child page table of content on your vuepress documentation
- This plugin requires VuePress >= 1.0.0.
Add a <ChildTableOfContents />
component that you can use in your markdown in order to get a Table of Contents for all the child page (meaning url starting with the current page url).
npm i vuepress-plugin-child-toc
Using this plugin:
// .vuepress/config.js
module.exports = {
plugins: ['vuepress-plugin-child-toc']
}
then add your table of components where you want in your markdown pages:
# All child page table of contents
<ChildTableOfContents />
# All child page table of contents with max 2 max distance level
<ChildTableOfContents :max="2"/>
# Add internal, anchor link in the table of contents
<ChildTableOfContents :header="true"/>
# Display Child TOC for this specific page
<ChildTableOfContents pageUrl="/blogs/"/>
Largely inspired from plugin vuepress-plugin-global-toc