fix(i18n): localePath 三处双 en 一刀治+canonical 全量(blog-5f T2/T3 车道收编)
- T2:localePath 先归一 zh 再拼前缀(Header/CommandPalette/
BaseLayout 三处 /en/en/ 同源病根一刀),返回值统一尾斜杠;
BaseLayout 自指 canonical 全量 35 页;E2E 新增 en canonical
自指断言(33→34)
- T3:content-lint.mjs 零依赖三检(断链 FAIL/缺图 FAIL/zh-en
配对 WARN;CONTENT_LINT 逃生门;photos-originals 叠加层与
/admin 单语两误报已修);prod-smoke.sh 三断言(robots 未落明
确 FAIL 不静默);build.sh 守卫行挂载(smoke 对 staging 首版
容忍,T1 robots 上线后转硬门,触发条件注释在案)
- tasks.md verify 字面量 33→34 联动同步(6 处)
车道:op-gitea(verify 六条实录);收编验收:E2E 34/34+产物零
/en/en/+lint 0/0/0 实跑复现
验证: node tests/e2e.mjs 34/34 PASS;! grep -r /en/en/ dist/;
content-lint 三检 0 违例;bash -n+test -x 过
Spec: 2026-10-26_blog-5f
Co-authored-by: GLM-5.3
This commit is contained in:
1 parent
8ec1712135
commit
c307285a25
7 files changed
+131
-9
No files matched your search
@@ -31,6 +31,9 @@ pnpm astro build
|
||||
[ -f scripts/build-perf/gen-sw-precache.mjs ] && node scripts/build-perf/gen-sw-precache.mjs dist || echo "[build] sw-precache 生成器未就绪,跳过"
|
||||
[ -f scripts/build-perf/inline-home-css.mjs ] && node scripts/build-perf/inline-home-css.mjs || echo "[build] inline-home 脚本未就绪,跳过"
|
||||
|
||||
# 内容 lint(T3):断链/缺图在部署前拦截;CONTENT_LINT=skip|warn 逃生门见脚本头注
|
||||
[ -f scripts/build-perf/content-lint.mjs ] && node scripts/build-perf/content-lint.mjs dist || echo "[build] content-lint 未就绪,跳过"
|
||||
|
||||
echo "[build] rsync -> $STAGING"
|
||||
mkdir -p "$STAGING"
|
||||
rsync -a --delete "$BUILD_REPO/dist/" "$STAGING/"
|
||||
@@ -38,3 +41,9 @@ ORIG="$HOME/docker_apps/blog/photos-originals"
|
||||
if [ -d "$ORIG" ]; then rsync -a "$ORIG/" "$STAGING/photos-originals/"; fi
|
||||
printf 'built %s at %s\n' "$SHA" "$(date -Is)" > "$STAGING/.build-stamp"
|
||||
echo "[build] done: $(find "$STAGING" -name '*.html' | wc -l) html files @ $SHA"
|
||||
|
||||
# 生产冒烟(T3):staging 三断言。首版容忍失败(robots 待 T1 落地,smoke FAIL 属预期),
|
||||
# T1 收编后改硬门:去掉 `|| echo` 让断言失败直接炸构建
|
||||
if [ -f scripts/build-perf/prod-smoke.sh ] && [ "${SMOKE_BASE:-http://127.0.0.1:18743}" != "off" ]; then
|
||||
bash scripts/build-perf/prod-smoke.sh "${SMOKE_BASE:-http://127.0.0.1:18743}" || echo "[build] prod-smoke 未过(见上;T1 robots 落地后转硬门)"
|
||||
fi
|
||||
Reference in new issue
Block a user