Skip to content

Commit df01762

Browse files
committed
fix(blog): add fragments to headings
1 parent 31033e7 commit df01762

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

modules/blog.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { join } from 'node:path'
22
import Markdown from 'unplugin-vue-markdown/vite'
33
import { addTemplate, addVitePlugin, defineNuxtModule, useNuxt, createResolver } from 'nuxt/kit'
44
import shiki from '@shikijs/markdown-it'
5+
import MarkdownItAnchor from 'markdown-it-anchor'
56
import { defu } from 'defu'
67
import { read } from 'gray-matter'
78
import { safeParse } from 'valibot'
@@ -72,6 +73,7 @@ export default defineNuxtModule({
7273
},
7374
}),
7475
)
76+
md.use(MarkdownItAnchor)
7577
},
7678
}),
7779
)

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
"focus-trap": "^8.0.0",
9696
"gray-matter": "4.0.3",
9797
"ipaddr.js": "2.3.0",
98+
"markdown-it-anchor": "9.2.0",
9899
"marked": "17.0.3",
99100
"module-replacements": "2.11.0",
100101
"nuxt": "4.3.1",

pnpm-lock.yaml

Lines changed: 14 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)