- Add translation field to schema + auto-match by zh/ prefix - BaseLayout accepts per-page switchHref; post page resolves translation link - Falls back to section landing (/ or /zh/) when no translation exists
This commit is contained in:
1 parent
677fc7cb20
commit
6b56c1f4db
3 files changed
+20
-3
No files matched your search
@@ -21,6 +21,9 @@ const posts = defineCollection({
|
||||
// lang is NOT set in frontmatter anymore — it's derived from the folder:
|
||||
// posts/hello-world.md -> en (flat)
|
||||
// posts/zh/hello-world.md -> zh (subfolder)
|
||||
// Explicit link to the other-language version (its full slug, e.g. "zh/how-i-host-this-blog").
|
||||
// When absent, the language switch falls back to the section landing page (/ or /zh/).
|
||||
translation: z.string().optional(),
|
||||
ogImage: z.string().optional(),
|
||||
}),
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user