vitepress icon indicating copy to clipboard operation
vitepress copied to clipboard

Is there any way to disable header anchors at all?

Open 0x7357 opened this issue 3 years ago • 1 comments

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.

0x7357 avatar Jun 02 '22 23:06 0x7357

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.

brc-dd avatar Jun 03 '22 05:06 brc-dd

// .vitepress/config.ts

export default {
  markdown: {
    anchor: {
      permalink: undefined
    }
  }
}

ID generation will still be there so the outline, router stuff won't break.

brc-dd avatar Jul 30 '23 19:07 brc-dd