diff options
| author | Adam <[email protected]> | 2026-02-09 11:34:35 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-09 11:34:35 -0600 |
| commit | dc53086c1e73d43d3a28fc4cdf161e83d09b1877 (patch) | |
| tree | 45a1d0e38de958d0886a5120b2806b21db74145b /packages/web/src/content.config.ts | |
| parent | f74c0339cc6315f7e7743e26b7eab47ce026c239 (diff) | |
| download | opencode-dc53086c1e73d43d3a28fc4cdf161e83d09b1877.tar.gz opencode-dc53086c1e73d43d3a28fc4cdf161e83d09b1877.zip | |
wip(docs): i18n (#12681)
Diffstat (limited to 'packages/web/src/content.config.ts')
| -rw-r--r-- | packages/web/src/content.config.ts | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/packages/web/src/content.config.ts b/packages/web/src/content.config.ts index d61471487..2ed34e4c3 100644 --- a/packages/web/src/content.config.ts +++ b/packages/web/src/content.config.ts @@ -1,7 +1,16 @@ -import { defineCollection } from "astro:content" -import { docsLoader } from "@astrojs/starlight/loaders" -import { docsSchema } from "@astrojs/starlight/schema" +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()])) export const collections = { docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), + i18n: defineCollection({ + loader: i18nLoader(), + schema: i18nSchema({ + extend: z.object(custom).catchall(z.string()), + }), + }), } |
