The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { docsLoader } from "@astrojs/starlight/loaders"; |
| 2 | import { docsSchema, i18nSchema } 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 | // The site is English-only, but Starlight always reads this collection for |
| 20 | // UI strings and Astro 7 warns when it is missing or empty. One empty entry |
| 21 | // keeps Starlight's built-in strings without a src/content/i18n directory. |
| 22 | i18n: defineCollection({ loader: () => [{ id: "en" }], schema: i18nSchema() }), |
| 23 | }; |