chore(spec): 创建 add-blog-i18n 任务包(Phase 3 八任务三车道)

Spec: 2026-10-25_add-blog-i18n

Co-authored-by: GLM-5.3
This commit is contained in:
wait4xandGLM-5.3 committed 2026-10-25 09:14:47 +08:00
1 parent 44bfb23efb
commit cf42081614
2 files changed
+134

No files matched your search

@@ -0,0 +1,56 @@
# Phase 3:双语骨架 + 腾讯 TMT 翻译管线 - 任务拆解
## 使用规则
- 每个任务 boundary/verify 齐备;verify 首个反引号 span 为执行命令;迁移教训:verify 只读断言(不重跑生成器)
## 阶段一:实现
- [ ] T1 astro i18n 配置 + locale 管道
- claim: orchestrator
- boundary: 只改 astro.config.mjs(i18n 段)与 src/lib/locale.ts(当前语言工具)
- verify: `pnpm astro build`
- [ ] T2 UI 字典 + 组件串接
- depends-on: task_0001
- claim: op-gitea(mesh 车道,预约 src/i18n/ 与 Footer/SearchDialog/gallery/moments/about)
- boundary: 新建 src/i18n/ui.ts(zh/en 字典)并串接 Footer/SearchDialog/gallery/moments/about 页的静态文案;不碰 Header/BaseLayout(orchestrator 的语言切换在那)
- verify: `pnpm astro build && grep -q "zh" dist/index.html`
- [ ] T3 语言切换组件(Header 中英互跳)
- depends-on: task_0001
- claim: orchestrator
- boundary: 只改 src/components/Header.astro 与 src/lib/locale.ts
- verify: `pnpm astro build && grep -q 'href="/en/"' dist/index.html`
- [ ] T4 /en/ 页面骨架 + AI 译文标注组件
- depends-on: task_0001
- claim: orchestrator
- boundary: 新建 src/pages/en/{index.astro,archives/[...slug].astro,archives/index.astro,gallery,moments,about}(复用组件+locale prop);src/components/AiTranslatedBadge.astro;posts-en 集合定义进 content.config.ts
- verify: `pnpm astro build && test -f dist/en/index.html`
- [ ] T5 TMT 翻译管线
- claim: op-artalk(mesh 车道,预约 scripts/translate/)
- boundary: 新建 scripts/translate/{tencent_tmt.py,translate_posts.py}:TC3-HMAC-SHA256 签名(--selftest 模式打印中间量)、段落分块(<2000 字符)、frontmatter 透传(title 翻译、locked:true 跳过)、.en.md 生成到 content/posts-en/、原文哈希记录防重译;凭据从宿主 0600 文件读(标签 Secert* 容错);不碰 src/、astro 配置
- verify: `python3 scripts/translate/translate_posts.py --dry-run`
- [ ] T6 存量翻译执行 + 标注落页
- depends-on: task_0004, task_0005
- claim: op-artalk(执行)+ orchestrator(验收)
- boundary: 真实调用 TMT 译 6 文入 content/posts-en/;/en/archives 模板挂 AiTranslatedBadge(T4 已备)
- verify: `test $(ls content/posts-en/*.md 2>/dev/null | wc -l) -eq 6`
- [ ] T7 hreflang + 双语 RSS + sitemap locale
- depends-on: task_0004
- claim: orchestrator
- boundary: BaseLayout 注入 hreflang 双向;src/pages/en/rss.xml.ts;sitemap 配置 i18n
- verify: `pnpm astro build && grep -q hreflang dist/index.html && test -f dist/en/rss.xml`
- [ ] T8 构建验收 + staging
- depends-on: task_0002, task_0003, task_0004, task_0006, task_0007
- claim: orchestrator
- boundary: build.sh 跑 staging;抽检 /en/ 三页(首页/一文/图库)渲染
- verify: `bash infra/deploy/build.sh && test -f ~/docker_apps/blog/www-staging/en/index.html`
---
**当前进度**:由脚本计算,无需手动维护