GitHub Pages 从根目录部署,不是 docs/ 目录!
仓库结构:
├── index.html ← GitHub Pages 用这个(旧版本)❌
├── docs/
│ └── index.html ← 我们更新的(新版本)✅
└── ...
# 检查 GitHub 上的文件(源文件)
curl -s https://raw.githubusercontent.com/qzw-alt/demi/master/index.html | grep "<title>"
# 检查 GitHub Pages 实际部署(绕过缓存)
curl -sH "Cache-Control: no-cache" https://chinahospitalsguide.com/ | grep "<title>"
# 对比两者是否一致
将 docs/ 内容同步到根目录:
cp -r docs/* .
git add -A
git commit -m "Sync docs to root for GitHub Pages"
git push
curl -H "Cache-Control: no-cache" 绕过缓存"不是 GitHub Pages 的问题,是我的理解问题"
no-cache 验证实际部署记录日期:2026-03-11 痛苦指数:⭐⭐⭐⭐⭐ 教训价值:无价