We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a3bcea commit 921dd78Copy full SHA for 921dd78
1 file changed
layers/documentation/server/plugins/content.ts
@@ -1,15 +1,10 @@
1
import { version } from '../../../../package.json'
2
3
-const markdownRe = /\.md$/g
4
-const placeholderRe = /__TAIRO_LAYERS_VERSION__/g
5
-
6
export default defineNitroPlugin((nitroApp) => {
7
// @ts-ignore
8
nitroApp.hooks.hook('content:file:beforeParse', (file) => {
9
- if (!markdownRe.test(file.path)) {
10
- return
+ if (file._id.endsWith('.md')) {
+ file.body = file.body.replaceAll('__TAIRO_LAYERS_VERSION__', `v${version}`)
11
}
12
13
- file.body = file.body.replace(placeholderRe, `v${version}`)
14
})
15
0 commit comments