table of contents with jump links for on-page anchors.
Install
From your site folder, run:
jprot add TocListThat downloads the self-contained component into theme/components/TocList.js,
where it is picked up automatically — the same way as any built-in component.
To remove it later, just delete that file.
Use it as a homepage section
Add an entry to the sections: list in jprot.config.js:
sections: [
{ component: 'TocList', title: 'TocList' },
]Use it inside a page
On its own line in any Markdown file, passing the props:
:::TocList items='[{"label":"Install","url":"#install"},{"label":"Usage","url":"#usage"},{"label":"Publish","url":"#publish"}]' title="On this page"Props
| Prop | Type | Note |
|---|---|---|
items | array | [{ label, url }] |
title | string | small heading |