- src/content.config.ts(Astro 7 唯一合法路径,旧 config.ts 会抛 LegacyContentConfigError——车道实测发现,经批复的边界修正) - posts(category→track 派生单源)/moments(text-image 互斥 refine)/ photos(json sidecar + jpg,exif 构建期 exifr 补全、frontmatter 可覆盖) - 样例:书评+技术文各 1、瞬间 3、照片 3(横竖方三比例,EXIF 三路径覆盖) - 附带 scripts/check-responsive.sh(T9 预置,随 T6 产物生效) - 车道 30min 超时于过度验证循环,产物完好,主会话收编续跑 验证: pnpm astro build exit 0(1.63s,含三集合加载) Spec: 2026-10-24_add-blog-skeleton Co-authored-by: GLM-5.3
4.3 KiB
4.3 KiB
Phase 1:Astro 骨架+设计系统+五页型+极客层 P0 - 任务拆解
使用规则
- 每个任务都要写清楚
boundary和verify;机器任务的 verify 以首个反引号 span 为执行的命令 - verify 命令不得自引用本包 check 门禁
- 多 agent 协作:任务可加
claim:行(信息约定);子代理车道须先 mesh_reserve 各自路径
阶段一:实现
-
T1 Astro 5 项目初始化(pnpm + TS strict + minimal)
- claim: orchestrator
- boundary: 只新建 package.json/pnpm-lock/astro.config.mjs/tsconfig.json/src/pages/index 占位;不装 UI 框架
- verify:
pnpm astro build
-
T2 设计 tokens 与全局样式(丙路线)
- depends-on: task_0001
- claim: orchestrator
- boundary: 只写 src/styles/{tokens.css,global.css};变量命名与 docs/博客重设计调研报告.md §3 参数一一对应
- verify:
pnpm astro build && test -f dist/index.html
-
T3 字体三轨自托管分片(文楷/思源黑/JBMono)
- depends-on: task_0002
- boundary: 只加字体 npm 依赖与 src/styles/fonts.css 引入;不引入 cn-font-split 构建步(预分片包方案,证伪则回退并记 2.5)
- verify:
pnpm astro build && test $(find dist -name "*.woff2" | wc -l) -gt 50
-
T4 内容集合与 EXIF loader(posts/moments/photos)
- depends-on: task_0001
- claim: lane-content(子代理,预留 src/content 与 src/lib)
- boundary: 只写 src/content.config.ts(2026-10-24 修正:Astro 7 已移除 src/content/config.ts 旧路径,唯一合法位置为 src/ 直下,经 supervisor 批复)、src/lib/{exif.ts,collections 辅助}、content/ 样例(书评/技术/瞬间各 1+、照片 3 张占位图含两种比例);EXIF 空值容错
- verify:
pnpm astro build
-
T5 布局/导航/页脚/明暗不闪烁
- depends-on: task_0002
- claim: orchestrator
- boundary: 只写 src/layouts/BaseLayout.astro 与 src/components/{Header,Footer,ThemeScript}.astro;导航 ≤4 项;页脚 ICP+built-from 槽位;inline 防闪烁脚本
- verify:
pnpm astro build && grep -q "陕ICP备2026014860号" dist/index.html
-
T6 五页型(首页/文章双模板/图库/瞬间/关于)
- depends-on: task_0004, task_0005
- claim: lane-pages(子代理,预留 src/components 与 src/pages 除 index 外路由)
- boundary: 只写页面与页面级组件(名片开场/分轨列表/书评衬线模板+引文组件/技术模板+TOC+进度条/图库 masonry+lightbox/瞬间时间线/关于含身份陈述空槽位);排版参数按报告 §3
- verify:
pnpm astro build && test -f dist/archives/deng-dai-ge-duo/index.html -a -f dist/gallery/index.html -a -f dist/moments/index.html -a -f dist/about/index.html
-
T7 极客层 P0(键盘+帮助/build-info/View Transitions/项目墙)
- depends-on: task_0005
- claim: lane-geek(子代理,预留 src/components/geek 与 src/data)
- boundary: 只写 geek 组件(keyboard+? 帮助浮层、built-from 注入 vite define、ClientRouter、项目墙构建时 fetch 双源+缓存兜底 JSON);不改页面结构
- verify:
pnpm astro build && grep -q "built from" dist/index.html -i && grep -q "ClientRouter\|view-transition" dist/index.html
-
T8 Pagefind + RSS + sitemap + Artalk 占位
- depends-on: task_0006
- claim: orchestrator
- boundary: 只加 astro-pagefind/@astrojs-rss/@astrojs-sitemap 集成与文章模板 Artalk 容器组件(无凭据占位);astro.config 修改限集成段
- verify:
pnpm astro build && test -d dist/pagefind -a -f dist/rss.xml -a -f dist/sitemap-index.xml
-
T9 响应式结构自查(§4e 断点全覆盖)
- depends-on: task_0006
- boundary: 只做断点/容器查询与触屏属性的静态断言脚本 scripts/check-responsive.sh(1120/820/760/560 四档 + 44px 触点 + safe-area + 100dvh),不改样式本体(缺陷回写对应组件修复)
- verify:
bash scripts/check-responsive.sh
-
T10 staging 部署演练(build.sh 填实)
- depends-on: task_0008, task_0009
- claim: orchestrator
- boundary: 只改 infra/deploy/build.sh 为真实 astro build+rsync;staging 产物断言;不碰 nginx/生产
- verify:
bash infra/deploy/build.sh && test -f ~/docker_apps/blog/www-staging/index.html && bash infra/deploy/rollback-dryrun.sh
当前进度:由脚本计算,无需手动维护