Skip to content

Commit b6bbb42

Browse files
authored
docs: no need to register manually nitro plugin
1 parent 005fdfd commit b6bbb42

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

docs/content/4.api/4.advanced.md

+7-18
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,14 @@ The module adds some hooks you can use:
1212

1313
`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).
1414

15-
- Create a plugin in the `server/plugins/` directory
15+
Create a plugin in the `server/plugins/` directory
1616

17-
```ts [server/plugins/content.ts]
18-
export default defineNitroPlugin((nitroApp) => {
19-
// ...
20-
})
21-
```
22-
23-
- Register the plugin in `nuxt.config.ts`
17+
```ts [server/plugins/content.ts]
18+
export default defineNitroPlugin((nitroApp) => {
19+
// ...
20+
})
21+
```
2422

25-
```ts [nuxt.config.ts]
26-
export default defineNuxtConfig({
27-
// ...
28-
nitro: {
29-
plugins: ['~/server/plugins/content.ts']
30-
}
31-
})
32-
```
3323

3424
### `content:file:beforeParse`
3525

@@ -44,8 +34,7 @@ Arguments:
4434

4535
### Example
4636

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:
4938

5039
```ts [server/plugins/content.ts]
5140
export default defineNitroPlugin((nitroApp) => {

0 commit comments

Comments
 (0)