fix(docs): 修复 deploy 死链 — 补跟踪缺失文件 + 收窄 docs gitignore#80
Merged
Conversation
…link) deploy-pages 在 CI(Linux/Node20)持续报 3 处死链,本地(macOS)构建却干净—— 跨环境相对路径解析差异。改为绝对站点路径(/guide/xxx、/adr/xxx、/architecture), VitePress 按 docs 根 + base 解析,与源文件位置/文件系统大小写无关。共 8 文件。 保留 ignoreDeadLinks:false 强制检查。
…itignore
根因:.gitignore 的 `docs/` 规则(本意忽略构建产物)过宽,把整个 docs 源树
都忽略了。first-person-narration-production.md 从未入库,本地存在但 CI 全新
检出缺失 → 3 处指向它的链接在 CI 报死链、deploy 构建失败。
- .gitignore: `docs/` → 仅忽略 docs/.vitepress/{dist,cache,.temp}/ +
docs/node_modules/ + docs/package-lock.json,源文件正常入库
(此前所有 docs 文件都靠 git add -f 才进库,根因即此)
- 补入漏跟踪的 first-person-narration-production.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
根因(关键)
.gitignore的docs/规则(本意只忽略构建产物)过宽,把整个 docs 源树都忽略了。first-person-narration-production.md从未入库——本地存在但 CI 全新检出缺失,导致 3 处指向它的链接报死链、deploy 构建失败。这也是此前所有 docs 文件都得git add -f才能入库的根因。修复
docs/→ 仅忽略docs/.vitepress/{dist,cache,.temp}/+docs/node_modules/+docs/package-lock.json,源文件正常入库。first-person-narration-production.md。/guide/xxx、/adr/xxx),解析无歧义、与 FS/源文件位置无关。验证
在本分支
workflow_dispatch跑 deploy-pages:build job 成功(死链已解决,build complete)。deploy job 因 Pages 环境保护规则只允许 main 部署而跳过——属预期,合并到 main 后即可正常部署。影响
保留
ignoreDeadLinks: false强制检查,今后断链/漏跟踪文件会在 CI 暴露。