Files
blog/scripts/check-responsive.sh
T
wait4xandGLM-5.3 80ff67e8fa feat(content): 三集合 schema 与 EXIF 构建期补全(T4 车道收编)
- src/content.config.ts(Astro 7 唯一合法路径,旧 config.ts 会抛
  LegacyContentConfigError——车道实测发现,经批复的边界修正)
- posts(category→track 派生单源)/moments(text-image 互斥 refine)/
  photos(json sidecar + jpg,exif 构建期 exifr 补全、frontmatter 可覆盖)
- 样例:书评+技术文各 1、瞬间 3、照片 3(横竖方三比例,EXIF 三路径覆盖)
- 附带 scripts/check-responsive.sh(T9 预置,随 T6 产物生效)
- 车道 30min 超时于过度验证循环,产物完好,主会话收编续跑

验证: pnpm astro build exit 0(1.63s,含三集合加载)

Spec: 2026-10-24_add-blog-skeleton
Co-authored-by: GLM-5.3
2026-10-24 23:36:59 +08:00

35 lines
1.8 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
# 响应式结构自查(§4e):四档断点 + 触屏 44px + 安全区 + dvh 的静态断言
# 依据:docs/博客重设计调研报告.md §4e;断点 1120/820/760/560
set -e
cd "$(dirname "$0")/.."
fail=0
check() { if eval "$2"; then echo " ok $1"; else echo " FAIL $1"; fail=1; fi }
CSS_SRC="src/styles/global.css src/components/*.astro src/layouts/*.astro"
check "断点 1120px(宽屏 TOC 常驻档)" \
"grep -rqE 'max-width: ?1120px|min-width: ?1120px|@container' \$CSS_SRC src/pages/*.astro 2>/dev/null"
check "断点 820px(笔电 TOC 收起档)" \
"grep -rqE 'max-width: ?820px|min-width: ?820px' \$CSS_SRC src/pages/*.astro 2>/dev/null"
check "断点 760px(平板竖屏档)" \
"grep -rqE 'max-width: ?760px|min-width: ?760px' \$CSS_SRC src/pages/*.astro 2>/dev/null"
check "断点 560px(手机档 + 正文降 18px)" \
"grep -rq 'max-width: 560px' src/styles/global.css"
check "移动端降档:--prose-size 到 18px" \
"grep -q 'prose-size-reading: 18px' src/styles/global.css"
check "触屏 44px 目标类(.tap)存在且被使用" \
"grep -rq 'class=\"tap' src/components src/layouts"
check "安全区 env(safe-area-inset-*) 使用" \
"grep -rq 'safe-area-inset' src/styles src/components src/layouts"
check "视口 viewport-fit=cover(刘海屏)" \
"grep -q 'viewport-fit=cover' src/layouts/BaseLayout.astro"
check "100dvh 或未使用视口高度陷阱(出现 100vh 即 FAIL)" \
"! grep -rn '100vh' src/ ; true"
check "动效总闸 prefers-reduced-motion" \
"grep -q 'prefers-reduced-motion: reduce' src/styles/global.css"
check "构建产物含 viewport-fit 与主题色 meta" \
"grep -q 'viewport-fit=cover' dist/index.html && grep -q 'theme-color' dist/index.html"
[ "$fail" = "0" ] && echo "responsive check: all ok" || { echo "responsive check: FAILURES above"; exit 1; }