部署与发布
构建产物说明
了解构建产物的结构和用途。
`build` 会在输出目录生成扁平化静态站点和 AI / machine-readable artifacts。进入这些产物的只有 `published` 内容。
站点文件
- `index.html`:站点根入口
- `<lang>/index.html`:语言首页
- `<lang>/<slug>/index.html`:canonical reader 页面
- `docs/<slug>/index.html` 与 `<lang>/docs/<slug>/index.html`:兼容旧路径的重定向页
- `404/index.html`:静态 404 页面
搜索与 AI 产物
- `search-index.<lang>.json`:静态搜索索引
- `llms.txt`:轻量级 AI 入口
- `llms-full.txt`:全站文本导出
- `mcp/index.json`:机器可读产物索引
- `mcp/pages.<lang>.json`:页面级摘要数据
- `mcp/chunks.<lang>.json`:按块切分的内容
- `mcp/navigation.<lang>.json`:发布后的导航数据
- `mcp/openapi/index.<lang>.json`:API sources 的机器可读索引(配置后生成)
- `build-manifest.json`:构建元信息
发布规则
- 只有 `published` 页面会进入 reader 页面、搜索索引、`llms.txt` 和 `mcp/` 目录
- `draft` 与 `in_review` 页面仍保留在源项目里,但不会暴露到公开产物
- 因此预览和构建结果都应以页面状态为准,而不是以文件是否存在为准
自定义输出目录
如果不想写到默认的 `dist/`,可以通过 CLI 参数覆盖输出目录。
npx @anydocs/cli build ./my-docs --output ./build