feat: locale routing (en flat, zh subfolder), language switcher, dark default
Deploy / build (push) Successful in 11s

- Derive lang from folder (posts/zh/* -> zh, else en); remove lang: frontmatter
- Change post route to [...slug] to capture nested zh paths
- Add nav language switcher (EN <-> 中文) + /zh/ landing page
- Default theme to dark (light opt-in via toggle)
- Translate hello-world-zh placeholder into English intro post
- Update case study: docker-compose sample + real install gotchas (commit history)
- Add docs/project-state.md (Tier 1/2/3 backlog)
This commit is contained in:
hoelee committed 2026-09-06 06:37:34 +08:00
1 parent a0b238bc98
commit e0d4b0fbb7
17 files changed
+318 -44

No files matched your search

+10 -1
View File
@@ -74,10 +74,13 @@ category: case-studies
tags: ["telegram", "n8n", "docker", "cloudflare"]
ogImage: "/og/digikedai-bot.png" # 1200×630, custom per post
draft: false
lang: en
---
```
**No `lang:` field** — language is derived from the file location:
- `posts/hello-world.md` → English (`en`)
- `posts/zh/hello-world.md` → Chinese (`zh`), served at `/posts/zh/hello-world/`
---
## 7. What to AVOID (anti-patterns)
@@ -102,4 +105,10 @@ lang: en
- **English is primary and non-negotiable** — the whole SEO strategy targets English queries.
- **Chinese (zh):** translate only the 2–3 best case studies. Cheap differentiation, opens zh-SG/zh-MY search.
- **Malay: skip for v1** — no dev-audience demand (the main site already has a dangling Malay config; don't repeat it).
### File layout (enforced by code)
- English posts: `src/content/posts/*.md` (flat, no subfolder).
- Chinese posts: `src/content/posts/zh/*.md` (subfolder → `/posts/zh/<slug>/`).
- Language is derived from the folder (see `src/lib/lang.ts`), so **do not** set a `lang:` field in frontmatter.
- Never let "I should translate this" block publishing an English post.