| 1 | import { docsLoader } from "@astrojs/starlight/loaders"; |
| 2 | import { docsSchema } from "@astrojs/starlight/schema"; |
| 3 | import { defineCollection, z } from "astro:content"; |
| 4 | import { blogSchema } from "starlight-blog/schema"; |
| 5 | |
| 6 | export const blogCategories = ["release", "post"] as const; |
| 7 | export type BlogCategory = (typeof blogCategories)[number]; |
| 8 | |
| 9 | export const collections = { |
| 10 | docs: defineCollection({ |
| 11 | loader: docsLoader(), |
| 12 | schema: docsSchema({ |
| 13 | extend: (ctx) => |
| 14 | blogSchema(ctx).extend({ |
| 15 | category: z.enum(blogCategories).optional(), |
| 16 | }), |
| 17 | }), |
| 18 | }), |
| 19 | }; |