feat(migrate): Halo 全量内容迁移(压缩版)——6文/21图/1瞬间 URL 1:1
- 正文源=线上渲染页(Halo 快照层 patch 残迹:泥潭/赎罪仅 2 字符),
pandoc html→gfm + tags API 显示名换算后分类:5 书评(五档情绪色)+1 技术
- 图库 21 张:长边 2400/q86 压缩入仓(原图 196M→9.5M——公开仓历史膨胀
与 nginx 100M 推送上限双杀;原图在 Phase 0 备份 tar 中永久留档)
- 瞬间 1 条;URL 1:1(6 slug 全等,零 301)
- 本提交由 7 个本地提交重写而成(清除已进历史的 196M blob,未推送过);
因 reset --soft 暂存竞态,一并包含 spec 归档文件
(.spec/specs/archive/2026-10-24_migrate-blog-content/)
验证: check_urls.py 6==6;astro build 11 页 exit 0(8.67s);
EXIF 管线跑通;staging 更新;halo healthy+200 全程未动
Co-authored-by: GLM-5.3
This commit is contained in:
1 parent
7b71acf223
commit
aea21c8694
74 files changed
+1381
-97
No files matched your search
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
"""URL 1:1 断言(Phase 2 T5):Halo slugs == 新站文件 slugs。
|
||||
|
||||
新站文章路由 = /archives/{文件名去 .md}/,与 Halo permalink 同构;
|
||||
集合差集非空即失败(多一篇少一篇都不行)。
|
||||
"""
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
old = {p["spec"]["slug"] for p in json.load(open(".migration/posts.json", encoding="utf-8"))}
|
||||
new = {f.stem for f in Path("content/posts").glob("*.md")}
|
||||
|
||||
missing = old - new # 旧有新无 → 404 风险
|
||||
extra = new - old # 新有旧无 → 无害但记录
|
||||
|
||||
print(f"halo slugs={len(old)} new slugs={len(new)}")
|
||||
for s in sorted(missing):
|
||||
print(f" MISSING: {s}")
|
||||
for s in sorted(extra):
|
||||
print(f" extra : {s}")
|
||||
sys.exit(1 if missing else 0)
|
||||
Reference in new issue
Block a user