post: 30 days of agent churn kept 23.5万 of 51.8万 lines (EN + ZH)
Deploy / build (push) Successful in 56s
Deploy / build (push) Successful in 56s
The commit-churn post the owner read and approved today, published in the first-person voice he asked for. - Voice rewrite before publishing: the draft opened on "when managers or recruiters ask how productive an engineer is" and addressed the reader in the second person throughout (you/your 12 -> 2, both in the CTA; ZH 你 5 -> 2). It now reads as a log entry: "Last week I did something I almost never bother to do: I counted my own commits." Headings moved from essay titles to actions. Numbers, the 5-repo table and every claim are unchanged. - Title changed at the owner's request: "Why 500,000 Lines of Commit Churn Only Left 230,000 Lines in Production" -> "I Committed 518,000 Lines in 30 Days. Production Kept 235,000." (ZH: 30 天提交 51.8 万行,生产环境只留下 23.5 万行), pubDate 2026-10-18. - Fixed two real defects found while making the card: the draft claimed "four automated gates" and listed three; and og-gen split titles at the word-count midpoint, breaking at "…Lines in / 30 Days" — the splitter now prefers a sentence boundary near the middle and falls back to the midpoint. - og PNG regenerated for the new title, thumbs and banner WebP re-derived. Measured: card 2 title lines, overflowY 0, measure_og_banner PASS (tags 1 row, banner delta 2), build clean, /posts/ monotonic with this post on top. Also queued the post at the head of the dev.to drip (queue 69 -> 70).
This commit is contained in:
1 parent
2060aaa166
commit
0d7384224d
9 files changed
+325
-23
No files matched your search
@@ -449,11 +449,26 @@ tags = stripped
|
||||
.filter(Boolean);
|
||||
|
||||
// ---------- build template substitutions ----------
|
||||
// split the long title into two balanced lines for readability
|
||||
// split the long title into two balanced lines for readability.
|
||||
// Prefer a sentence boundary near the middle (". " / "? " / "! " / " — " / ": ") so a
|
||||
// line never dangles on a preposition ("…Lines in / 30 Days") when the title states a
|
||||
// headline and then a punchline; fall back to the word-count midpoint.
|
||||
const words = title.split(' ');
|
||||
const mid = Math.ceil(words.length / 2);
|
||||
const line1 = words.slice(0, mid).join(' ');
|
||||
const line2 = words.slice(mid).join(' ');
|
||||
let line1 = words.slice(0, mid).join(' ');
|
||||
let line2 = words.slice(mid).join(' ');
|
||||
const boundary = /[.?!#—:]\s+/g;
|
||||
let best = -1;
|
||||
let bm;
|
||||
while ((bm = boundary.exec(title)) !== null) {
|
||||
const cut = bm.index + 1; // keep the punctuation on the first line
|
||||
if (cut < title.length * 0.3 || cut > title.length * 0.75) continue;
|
||||
if (best === -1 || Math.abs(cut - title.length / 2) < Math.abs(best - title.length / 2)) best = cut;
|
||||
}
|
||||
if (best > 0) {
|
||||
line1 = title.slice(0, best).trim();
|
||||
line2 = title.slice(best).trim();
|
||||
}
|
||||
// escape HTML
|
||||
const esc = (s) => s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
||||
// title size: short titles can be larger
|
||||
|
||||
Reference in new issue
Block a user