astro-build
构建并验证 DMBlog(astro build + pagefind + 页面计数检查)
- License 许可
- MIT
- 最近更新
- 2026-07-11
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- astro-build
- description
- 构建并验证 DMBlog(astro build + pagefind + 页面计数检查)
03 SKILL.md 正文
astro-build — 构建并验证 DMBlog 项目
执行完整的构建流程并验证输出,确保项目无错误。
构建流程
1. 构建 Astro 静态站点
npx astro build
期望结果:astro build 完成,输出 dist/ 目录,列出生成的页面数量。
标准输出应显示类似 "Pages built: X" 或列出每个页面路径,最终应有 "✓ Build complete"。
2. 生成 Pagefind 搜索索引
npx pagefind --site dist
期望结果:Pagefind 将搜索索引写入 dist/pagefind/ 目录。
3. 验证构建输出
检查以下内容:
dist/目录存在且非空dist/pagefind/目录存在(含pagefind-entry.json等文件)- 页面数量符合预期(至少包含首页、归档页、about 页、文章详情页)
# 列出 dist 根目录的文件
Get-ChildItem dist -Name
# 检查 dist 中包含多少个 HTML 文件
Get-ChildItem dist -Recurse -Filter *.html | Measure-Object
错误处理
如果 astro build 失败:
- 检查错误堆栈(通常是 TypeScript 类型错误或 Astro 组件错误)
- 使用
astro check进行类型检查(如果可用) - 逐文件修复后重新构建
如果 pagefind 失败:
- 检查
dist/目录是否包含所有静态文件 - 确保没有 Pagefind 配置冲突
注意事项
- 在 PowerShell 中,用
;而不是&&分隔多个命令 - 构建前确保 dev server 已关闭(
astro dev stop) - 如果只想构建而不搜索,用
npm run build;如需搜索,用npm run postbuild
04 同仓库更多 Skills
writing-shape
Writing, exploit — shape raw material into an article, paragraph by paragraph.
writing-great-skills
Reference for writing and editing skills well — the vocabulary and principles that make a skill predictable.
writing-fragments
Writing, explore — mine raw fragments, no structure yet.
writing-beats
Writing, exploit — assemble raw material into a journey of beats, grounding each term before a beat leans on it.
wizard
Generate an interactive bash wizard that walks a human through a manual procedure — third-party setup, a one-off migration, an A→B state transition — opening URLs, capturing values, confirming each step, and writing .env files and GitHub Actions secrets.
wayfinder
Plan a huge chunk of work — more than one agent session can hold — as a shared map of investigation tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.