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