Skip to content

Fix build script dropping insights thumbnails and article links#50

Merged
chellej merged 1 commit into
masterfrom
fix/insights-page-generator-drift
Jul 16, 2026
Merged

Fix build script dropping insights thumbnails and article links#50
chellej merged 1 commit into
masterfrom
fix/insights-page-generator-drift

Conversation

@chellej

@chellej chellej commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • scripts/generate-site.py's INSIGHTS_ARTICLES data never carried the per-article thumbnail image or destination slug that were hand-patched directly into site/insights.html in Use new insights thumbnails #48/Add story card thumbnail images to insights page #49. Any rebuild (make build, or the CI Generate site step) silently regenerated insights.html without the thumbnails and pointed every "Read" link at /contact.html instead of the actual report page.
  • Fixed by adding slug, image, and image_alt fields to INSIGHTS_ARTICLES and rendering them in insights_main(), so the generator is the single source of truth again and a rebuild can no longer regress this content.
  • Out-of-scope but adjacent, included per maintainer practice: the shared footer copy in the chrome template had already been corrected in the generator source but never baked into the committed HTML - this rebuild picks that up across every page, along with a same-day sitemap.xml lastmod refresh. Both are inherent side effects of running a full, correct rebuild.

Root cause

Content was patched into generated HTML output directly instead of into the generator's source data, so the two drifted silently. The fix moves the data back into the generator so site/*.html is once again fully reproducible from scripts/generate-site.py.

Test plan

  • python3 scripts/generate-site.py runs clean, writes 37 files
  • Diffed output against the pre-existing committed site/insights.html - thumbnails and article links now match exactly
  • Ran the build a second time - zero diff (idempotent)
  • Ran the CI link-checker's internal-link scan against the regenerated site/ - 0 missing links
  • python3 -m py_compile scripts/generate-site.py

scripts/generate-site.py's INSIGHTS_ARTICLES data never carried the
per-article thumbnail image or slug that recent commits (b525494,
988d927) hand-patched directly into site/insights.html. Any rebuild
(make build, or CI) silently regenerated insights.html without the
images and pointed every "Read" link at /contact.html instead of the
actual report page - a regression that reappeared every time the
generator ran.

Root cause: content was patched into the generated HTML output
directly instead of into the generator's source data, so the two
drifted. Fixed by adding slug/image/alt fields to INSIGHTS_ARTICLES
and rendering them in insights_main(), making the generator the
single source of truth again.

Own every bug you see: this rebuild also carries forward an
already-pending footer copy tweak that was present in the shared
chrome template source but never baked into the committed HTML, plus
a same-day sitemap.xml lastmod refresh - both are side effects of
running a full, correct rebuild rather than a hand-patch.

Verified: the build is idempotent (a second run produces no diff),
and the CI link-checker's internal-link scan passes with zero
missing links.

Signed-off-by: chellej <197998703+chellej@users.noreply.github.com>
@chellej
chellej merged commit 4af9377 into master Jul 16, 2026
3 checks passed
@chellej
chellej deleted the fix/insights-page-generator-drift branch July 16, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants