docs: clarify page headers config (#5233)

pull/5235/head
T 3 months ago committed by GitHub
parent 756a88cfa2
commit b2cc1e0d69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -62,6 +62,8 @@ interface PageData {
}
```
`page.headers` is populated only when [`markdown.headers`](./site-config#markdown) is enabled. Without that option, it remains an empty array. The default theme outline reads rendered headings from the page content, so it can still appear when `page.headers` is empty.
**Example:**
```vue

@ -561,6 +561,8 @@ export default {
Check the [type declaration and jsdocs](https://github.com/vuejs/vitepress/blob/main/src/node/markdown/markdown.ts) for all the options available.
Set `markdown.headers` to `true` or pass [`@mdit-vue/plugin-headers`](https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-headers) options to collect headings into [`useData().page.headers`](./runtime-api#usedata). This option is disabled by default.
### vite
- Type: `import('vite').UserConfig`

Loading…
Cancel
Save