| 1 | import { defineCollection, defineConfig } from "@content-collections/core"; |
| 2 | import { compileMDX } |
| 3 | import rehypeShiki from "@shikijs/rehype |
| 4 | |
| 5 | const englishWritings = defineCollection |
| 6 | name: "englishWritings", |
| 7 | directory: "content/writings/en", |
| 8 | include: "*.mdx", |
| 9 | schema: (z) |
| 10 | title: z.string |
| 11 | summary: z.string |
| 12 | locale: z.literal |
| 13 | }), |
| 14 | transform: async ( |
| 15 | const mdx = |
| 16 | rehypePlugins: [[rehypeShiki, |
| 17 | }); |
| 18 | return { |
| 19 | ...document, |
| 20 | mdx, |
| 21 | }; |
| 22 | }, |
| 23 | }); |
| 24 | |
| 25 | const germanWritings = defineCollection |
| 26 | name: "germanWritings", |
| 27 | directory: "content/writings/de", |
| 28 | include: "*.mdx", |
| 29 | schema: (z) |
| 30 | title: z.string |
| 31 | summary: z.string |
| 32 | locale: z.literal |
| 33 | }), |
| 34 | transform: async ( |
| 35 | const mdx = |
| 36 | rehypePlugins: [[rehypeShiki, |
| 37 | }); |
| 38 | return { |
| 39 | ...document, |
| 40 | mdx, |
| 41 | }; |
| 42 | }, |
| 43 | }); |
| 44 | |
| 45 | export default defineConfig({ |
| 46 | collections: [englishWritings, |
| 47 | }); |