opencode/packages/web/src/content.config.ts

17 lines
562 B
TypeScript
Raw Normal View History

2026-02-10 01:34:35 +08:00
import { defineCollection, z } from "astro:content"
import { docsLoader, i18nLoader } from "@astrojs/starlight/loaders"
import { docsSchema, i18nSchema } from "@astrojs/starlight/schema"
import en from "./content/i18n/en.json"
const custom = Object.fromEntries(Object.keys(en).map((key) => [key, z.string()]))
2025-05-22 02:24:53 +08:00
export const collections = {
2025-06-01 02:41:00 +08:00
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
2026-02-10 01:34:35 +08:00
i18n: defineCollection({
loader: i18nLoader(),
schema: i18nSchema({
extend: z.object(custom).catchall(z.string()),
}),
}),
2025-06-01 02:41:00 +08:00
}