You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/content/4.api/4.advanced.md
+7-18
Original file line number
Diff line number
Diff line change
@@ -12,24 +12,14 @@ The module adds some hooks you can use:
12
12
13
13
`content:file:*` hooks are available in nitro runtime, in order to use them you need to create a custom [nitro plugin](https://nitro.unjs.io/guide/plugins.html).
14
14
15
-
-Create a plugin in the `server/plugins/` directory
15
+
Create a plugin in the `server/plugins/` directory
16
16
17
-
```ts [server/plugins/content.ts]
18
-
exportdefaultdefineNitroPlugin((nitroApp) => {
19
-
// ...
20
-
})
21
-
```
22
-
23
-
- Register the plugin in `nuxt.config.ts`
17
+
```ts [server/plugins/content.ts]
18
+
exportdefaultdefineNitroPlugin((nitroApp) => {
19
+
// ...
20
+
})
21
+
```
24
22
25
-
```ts [nuxt.config.ts]
26
-
exportdefaultdefineNuxtConfig({
27
-
// ...
28
-
nitro: {
29
-
plugins: ['~/server/plugins/content.ts']
30
-
}
31
-
})
32
-
```
33
23
34
24
### `content:file:beforeParse`
35
25
@@ -44,8 +34,7 @@ Arguments:
44
34
45
35
### Example
46
36
47
-
Changing all occurrences of react to vue in all Markdown files:
48
-
37
+
Changing all occurrences of React to Vue in all Markdown files:
0 commit comments