Repository navigation
fix(og): 社交卡片写着 76 条(实际 82),并补上它缺失的生成源与闸门 - #107
Merged
Merged
Conversation
那张 og-cover.png 从 2026-07-10 起就写着「76 pitfalls」,两个月里书涨到 82, 没人发现——因为**这个数字只存在于像素里,没有任何检查读得到它**。仓库里也 没有生成源,改都无从改起。 所以这次不只是把 76 改成 82: - 新增 scripts/og-cover/og-cover.html —— 卡片的生成源,数字是文本 - 新增 scripts/og-cover/render.sh —— 无头 Chrome 渲染回 2560x1280 PNG (`--headless=new` 是必须的:旧的 `--headless` 在这台机器上会无限挂起) - scripts/check-counts.js 把这个数字纳入受检计数,跟 core-20 / intro / CLAUDE.md 那几处一样,再漂移就会红 这正是本书 07「文档不是防护」那条讲的东西用在自己身上:一个没有检查能读到 的声明,只是散文。 闸门:check:counts(现查 8 处)/ check:mirror / check:mirror-deep / cspell 全过,两 locale 两实例 build 通过。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
上一个提交在英文 label 外面套了中文直角引号「」,CI 的 autocorrect 报 scripts/check-counts.js:69 一处 Error,#107 因此变红。同文件其他英文 label ("All N entries is a lot" 等)都用 ASCII 双引号,这里改成一致。 这次在推之前本地跑过同一道闸门:CI 用的是 npm 包 autocorrect-node@2.8.4, `npx --yes autocorrect-node@2.8.4 --lint .` 全仓 Error 0。上次红,是因为我以为 autocorrect 本机跑不了、只能等 CI——其实它能跑,只是没有全局命令。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
static/img/og-cover.png从 2026-07-10 起写着 「76 pitfalls」,书早已是 82 条。这是分享到任何地方时别人看到的第一眼数字。两个月没人发现,原因很具体:这个数字只存在于像素里,没有任何检查读得到它。仓库里也没有生成源——想改都无从改起。
改了什么
不只是把 76 换成 82:
scripts/og-cover/og-cover.html(新增)scripts/og-cover/render.sh(新增)scripts/check-counts.jsstatic/img/og-cover.png再漂移就会红:
一个渲染上的坑,写进脚本注释了
--headless(旧模式)在这台机器上会无限挂起;必须用--headless=new,并配--virtual-time-budget兜住字体解析,加--no-first-run等标志避免临时 profile 卡在初始化。这条修的其实是本书自己的一条误区
07「文档不是防护」讲的是:一个没有检查能读到的声明,只是散文。 那张 PNG 就是标准案例——它对外声明了一个数字,而没有任何东西能验证它。所以这次的修法是给它配一个会变红的东西,而不只是把数字改对。
测试计划
npm run check:counts— 8 处手写计数全部 = 82npm run check:mirror/check:mirror-deep— 157 对配对完整、结构对等npx cspell— 0 issuenpm run build— 两 locale 两实例通过vale/autocorrect— 本机未装,靠 CI🤖 Generated with Claude Code