Skip to content

Commit eeaaf91

Browse files
committed
chore: use github-slugger to align anchors
1 parent 6a59822 commit eeaaf91

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

.vitepress/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { slug as githubSlug } from 'github-slugger';
12
import { defineConfig } from 'vitepress';
23
import { groupIconMdPlugin, groupIconVitePlugin } from 'vitepress-plugin-group-icons';
34

@@ -49,6 +50,9 @@ export default defineConfig({
4950
description: 'The most powerful data validation library for JS',
5051
head: [['link', { href: '/favicon2.png', rel: 'icon' }]],
5152
markdown: {
53+
anchor: {
54+
slugify: (s) => githubSlug(s),
55+
},
5256
config(md) {
5357
md.use(groupIconMdPlugin);
5458
},

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"codemirror": "^6.0.2",
3535
"es-toolkit": "^1.45.1",
3636
"feed": "^5.2.0",
37+
"github-slugger": "^2.0.0",
3738
"joi-17": "npm:joi@17.13.3",
3839
"joi-18": "npm:joi@18.2.1",
3940
"prettier": "^3.8.1",

pnpm-lock.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)