本地检查
按顺序执行,遇到第一个错误就停止并修复:
docker build -t bytetuto-site:local .
docker run --rm bytetuto-site:local nginx -t
docker rm -f bt-check 2>/dev/null; docker run -d --name bt-check -p 8088:80 bytetuto-site:local
sleep 2
curl -fsS http://localhost:8088/healthz # -> ok
curl -fsS http://localhost:8088/ | grep -c byteTuto # > 0
curl -s -o /dev/null -w '%{http_code}\n' http://localhost:8088/x # -> 404
curl -sI http://localhost:8088/ | grep -iE 'content-security|x-frame|cache-control'
curl -sI http://localhost:8088/index.md | grep -i 'content-type: text/markdown'
curl -s -H 'Accept: text/markdown' http://localhost:8088/ | head -3 # -> front matter ---
python3 scripts/check_seo_agents.py # SEO + 代理友好
python3 scripts/check_responsive.py --base http://localhost:8088 --shots /tmp/rs # 响应式 (Playwright)
docker rm -f bt-check
Playwright 首次使用:pip install playwright && python3 -m playwright install chromium。
Shell 脚本:bash -n deploy/*.sh nginx/*.sh(如果安装了 shellcheck 也可以运行它)。
需肉眼检查的要点(开发模式:docker compose -f docker-compose.dev.yml up → http://localhost:8080)
- 背景动画流畅运行,且在启用“减少动画”时停止。
- 控制台无错误(CSP 会阻止所有内联脚本:JS 存放在
site/app.js中)。 - 截图
/tmp/rs/*-320x640.png和*-375x667.png:内容无裁剪,无元素紧贴边缘。 - 符合品牌规范(参见技能
bytetuto-brand)。