vitepress
vitepress copied to clipboard
Is there any way to disable header anchors at all?
Currently I use CSS .header-anchor { display: none; } (just an example) to hide header anchors. But I find this very messy. How can I disable header anchors in general? I have found absolutely no solution.
I have checked the following pages: https://vitepress.vuejs.org/guide/markdown.html https://v1.vuepress.vuejs.org/config/#markdown-anchor https://github.com/valeriangalliat/markdown-it-anchor
Unfortunately, there are only "adjustments", but no way to disable these anchors.
You cannot disable header anchors. Many of our features including outline and router depend on it. For now, you can try setting visibility: hidden on .header-anchor. Setting display: none, will remove them from the DOM, which will mess things up.
// .vitepress/config.ts
export default {
markdown: {
anchor: {
permalink: undefined
}
}
}
ID generation will still be there so the outline, router stuff won't break.