added whole content

This commit is contained in:
Fedor Katurov 2022-11-03 10:38:11 +06:00
parent 1b5df685cb
commit 8b25e0631a
70 changed files with 5962 additions and 19 deletions

View file

@ -0,0 +1,16 @@
By default [Nuxt Content Plugin](https://content.nuxtjs.org) not handling `==highlight==` links. To fix that we will create `Nitro` plugin:
```typescript
// ~/server/plugins/highlight.ts
export default defineNitroPlugin((nitroApp) => {
nitroApp.hooks.hook("content:file:beforeParse", (file) => {
if (file._id.endsWith(".md")) {
file.body = file.body.replace(
/==([^=]+)==/gs,
`<span class="highlight">$1</span>`
);
}
});
});
```