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

+2 -1
View File
@@ -2,9 +2,10 @@
import BaseLayout from '../layouts/BaseLayout.astro';
import PostList from '../components/PostList.astro';
import { getCollection } from 'astro:content';
import { isEn } from '../lib/lang';
import { SITE } from '../config';
const posts = (await getCollection('posts', ({ data }) => !data.draft && data.lang === 'en'))
const posts = (await getCollection('posts', isEn))
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf());
---