| 1 | import { defineCollection, defineConfig } from "@content-collections/core"; |
| 2 | import { compileMDX } |
| 3 | import rehypeShiki from "@shikijs/rehype |
| 4 | // for more information on configuration, visit: |
| 5 | // https://www.content-collections.dev/docs/configuration |
| 6 | |
| 7 | const writings = defineCollection |
| 8 | name: "writings", |
| 9 | directory: "content/writings", |
| 10 | include: "*.mdx", |
| 11 | schema: (z) |
| 12 | title: z.string |
| 13 | summary: z.string |
| 14 | }), |
| 15 | transform: async ( |
| 16 | const mdx = |
| 17 | rehypePlugins: [[rehypeShiki, |
| 18 | }); |
| 19 | return { |
| 20 | ...document, |
| 21 | mdx, |
| 22 | }; |
| 23 | }, |
| 24 | }); |
| 25 | |
| 26 | export default defineConfig({ |
| 27 | collections: [writings], |
| 28 | }); |