Skip to content

Commit 5af58a1

Browse files
authored
Merge pull request #12 from nightt5879/codex/1.1.0-seo-i18n
feat: implement 1.1.0 SEO and locale hardening
2 parents 3e572fd + 5251a99 commit 5af58a1

42 files changed

Lines changed: 484 additions & 53 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agent/PLAN.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@
1515
- [x] T-0010:最小内容运营流程(0代码可执行)
1616
- [x] T-0011:基础收官验收包(交付与交接)
1717

18+
## M4 线上可索引与双语体验
19+
- [ ] T-0012:SEO 与 i18n 基础加固
20+
1821
参考:`docs/roadmap.md`
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Intent
2+
3+
- Task: `T-0012`
4+
- Branch: `codex/1.1.0-seo-i18n`
5+
- Goal: 完成 1.1.0 的 SEO / i18n 基础加固,并保留可审计的自验证证据。
6+
7+
## Planned Scope
8+
- 生产站点 URL 配置
9+
- canonical / Open Graph / hreflang / robots
10+
- 当前页语言切换
11+
- 构建后 SEO / i18n 校验
12+
- 文档与变更记录同步
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Actions
2+
3+
- 2026-03-26: 创建 `T-0012` 任务与本次 RUN 骨架。
4+
- 2026-03-26: 读取现有路由、布局、CI 与 agent workflow 配置,确认 1.1.0 的实现边界。
5+
- 2026-03-26: 新增 `src/utils/seo.ts`,统一站点 URL、canonical、hreflang 与摘要逻辑。
6+
- 2026-03-26: 更新 `astro.config.mjs``BaseLayout.astro` 与页面描述,补齐 canonical / OG / robots / 当前页语言互跳。
7+
- 2026-03-26: 新增 `scripts/verify-seo-i18n.mjs`,并串到 `package.json`、CI 与 `verify.bat`
8+
- 2026-03-26: 更新 README、release checklist、roadmap、changelog 与 `.env.example`
9+
- 2026-03-26: 完成本地自验证:`verify.bat --no-pause` 通过。
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Self Check
2+
3+
## Commands
4+
5+
```bash
6+
npm run validate:content
7+
cmd /c verify.bat --no-pause
8+
```
9+
10+
## Result
11+
12+
- `validate:content`:通过
13+
- `build`:通过
14+
- `test:smoke`:通过
15+
- `test:seo`:通过
16+
17+
## Notes
18+
19+
- `verify.bat` 会自动设置 `ASTRO_TELEMETRY_DISABLED=1`
20+
- 本次 SEO / i18n 校验覆盖 canonical、Open Graph、hreflang、404 noindex 与当前页语言互跳
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Summary
2+
3+
## Done
4+
5+
- 为站点增加环境变量优先的生产 URL 配置
6+
- 在共享布局层补齐 canonical、Open Graph、Twitter card、hreflang 与 robots
7+
- 把页脚语言切换改成当前页面中英互跳
8+
- 增加构建后的 SEO / i18n 校验,并串入 `verify.bat` 与 CI
9+
- 更新 1.1.0 文档与版本记录
10+
11+
## Evidence
12+
13+
- `.agent/RUNS/2026-03-26_t0012-seo-i18n/02-evidence/self-check.md`
14+
- `verify.bat --no-pause`
15+
16+
## Diff
17+
18+
- 新增:`src/utils/seo.ts``scripts/verify-seo-i18n.mjs``.env.example`
19+
- 更新:`astro.config.mjs``src/layouts/BaseLayout.astro`、各中英文页面、`verify.bat`、CI、README、roadmap、changelog
20+
21+
## Next
22+
23+
- 提交分支 commit
24+
- 准备 PR 描述与自验证结果
25+
- 交由云端 Codex 做第二层 review
26+
27+
## Risk
28+
29+
- 若生产域名后续变更但未同步 `PUBLIC_SITE_URL`,canonical / hreflang 会指向旧域名
30+
- 当前页语言互跳基于中英文路径镜像关系;若未来新增非对称路由,需要补专用映射

.agent/STATUS.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"current_task": "process-audit",
3-
"phase": "closure",
4-
"progress": 1.0,
5-
"last_update": "2026-03-04T14:58:00+08:00",
2+
"current_task": "T-0012-seo-i18n-hardening",
3+
"phase": "review",
4+
"progress": 0.95,
5+
"last_update": "2026-03-26T15:58:00+08:00",
66
"next_steps": [
7-
"Create a new task ID for the next UI iteration before coding",
8-
"Keep RUN evidence updated for each future request"
7+
"Review staged diff and create a clear commit for the 1.1.0 branch",
8+
"Open a PR and hand the branch to cloud Codex for a second review pass"
99
],
1010
"blockers": [],
1111
"evidence": [
12-
".agent/RUNS/2026-03-04_process-audit/02-evidence/terminal.log"
12+
".agent/RUNS/2026-03-26_t0012-seo-i18n/02-evidence/self-check.md"
1313
]
1414
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# T-0012: SEO 与 i18n 基础加固
2+
3+
## Goal
4+
让站点具备稳定的生产 SEO 基础能力,并让中英文页面支持“当前页互跳”。
5+
6+
## Scope
7+
- In-scope:
8+
- 生产域名改为环境变量优先、正式域名兜底
9+
- 在布局层补 canonical、Open Graph、hreflang、robots 基础 meta
10+
- 实现当前页面的中英互跳
11+
- 增加 SEO / i18n 的构建后校验脚本
12+
- 更新 README、roadmap、changelog 与 agent 留痕
13+
- Out-of-scope:
14+
- CMS 接入
15+
- 结构化数据、自动 OG 图片生成
16+
- 新内容类型或新页面功能
17+
18+
## Acceptance Criteria
19+
- [x] `astro.config.mjs` 支持环境变量站点地址,并且构建结果不再写死 localhost
20+
- [x] 首页、列表页、详情页产出 canonical / OG / hreflang
21+
- [x] 语言切换可在当前页面对应的中英文地址之间跳转
22+
- [x] 验证通过:`verify.bat --no-pause`
23+
- [x] 文档已更新:`README.md``README_EN.md``docs/roadmap.md``CHANGELOG.md`
24+
25+
## Constraints
26+
- 不允许破坏性改动(除非批准)
27+
- 依赖策略:默认不新增依赖
28+
29+
## Risks
30+
- SEO 标签集中到布局层后,若路径归一化有误,可能导致 canonical / hreflang 指向错误页面
31+
- 通过构建后脚本检查首页、列表页、详情页来降低回归风险
32+
33+
## Progress Log
34+
- 2026-03-26: 创建任务,准备对齐站点地址、布局 SEO 标签与双语当前页互跳。
35+
- 2026-03-26: 完成环境变量站点地址、布局 SEO 标签、当前页语言互跳与构建后 SEO / i18n 校验。

.agent/WORKLOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,10 @@
1717
- 按要求执行流程限制学习:已阅读 `.agent/CONTRACT.md``STATUS.json``WORKLOG.md``PLAN.md``TASKS/*` 与最新 `RUNS` 样例。
1818
- 新增开发留痕:`.agent/RUNS/2026-03-04_process-audit/`(intent/actions/evidence/summary)。
1919
- 明确后续执行规范:每次开发继续维护 `STATUS.json``WORKLOG.md``RUNS/*`
20+
21+
## 2026-03-26
22+
- 新增 T-0012:1.1.0 的 SEO / i18n 基础加固。
23+
- 创建 RUN 留痕:`.agent/RUNS/2026-03-26_t0012-seo-i18n/`
24+
- 开始梳理站点 URL、布局 SEO 标签、当前页语言互跳与自验证链路。
25+
- 完成环境变量站点地址、canonical / OG / hreflang / robots、当前页语言互跳与构建后 `test:seo`
26+
- 本地自验证通过:`verify.bat --no-pause`

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PUBLIC_SITE_URL=https://doubleducklab.com

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ jobs:
3232

3333
- name: Smoke test built routes
3434
run: npm run test:smoke
35+
36+
- name: Verify SEO and locale alternates
37+
run: npm run test:seo

0 commit comments

Comments
 (0)