| 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 | date: z.coerce |
| 14 | }), |
| 15 | transform: async ( |
| 16 | const mdx = |
| 17 | rehypePlugins: [[rehypeShiki, |
| 18 | }); |
| 19 | return { |
| 20 | ...document, |
| 21 | mdx, |
| 22 | }; |
| 23 | }, |
| 24 | }); |
| 25 | |
| 26 | const germanWritings = defineCollection |
| 27 | name: "germanWritings", |
| 28 | directory: "content/writings/de", |
| 29 | include: "*.mdx", |
| 30 | schema: (z) |
| 31 | title: z.string |
| 32 | summary: z.string |
| 33 | locale: z.literal |
| 34 | date: z.coerce |
| 35 | }), |
| 36 | transform: async ( |
| 37 | const mdx = |
| 38 | rehypePlugins: [[rehypeShiki, |
| 39 | }); |
| 40 | return { |
| 41 | ...document, |
| 42 | mdx, |
| 43 | }; |
| 44 | }, |
| 45 | }); |
| 46 | |
| 47 | export default defineConfig({ |
| 48 | collections: [englishWritings, |
| 49 | }); |