本地端檢查
依序執行,碰到第一個錯誤就停下來修正:
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 # -> 前置資料 ---
python3 scripts/check_seo_agents.py # SEO + 對 AI 代理友善
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 會封鎖所有內聯腳本:JavaScript 均放在
site/app.js中)。 - 螢幕截圖
/tmp/rs/*-320x640.png和*-375x667.png:無內容被裁切,無內容貼齊邊緣。 - 品牌規範相符(請參閱技能
bytetuto-brand)。