Skip to content

Commit 921dd78

Browse files
chore: update nuxt content plugin
1 parent 6a3bcea commit 921dd78

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
import { version } from '../../../../package.json'
22

3-
const markdownRe = /\.md$/g
4-
const placeholderRe = /__TAIRO_LAYERS_VERSION__/g
5-
63
export default defineNitroPlugin((nitroApp) => {
74
// @ts-ignore
85
nitroApp.hooks.hook('content:file:beforeParse', (file) => {
9-
if (!markdownRe.test(file.path)) {
10-
return
6+
if (file._id.endsWith('.md')) {
7+
file.body = file.body.replaceAll('__TAIRO_LAYERS_VERSION__', `v${version}`)
118
}
12-
13-
file.body = file.body.replace(placeholderRe, `v${version}`)
149
})
1510
})

0 commit comments

Comments
 (0)