Restore the 19 gallery images the conversion dropped - #44
Merged
Conversation
Five gallery shortcodes across three posts were emitted empty. The ESP32 post announced "Below are pictures of the finished case and the utility meters:" and rendered an empty div. wp2hugo wrote the wrapper and dropped what it wrapped: WordPress used Gutenberg's wp-block-gallery with nested figures, and only the outer element survived the conversion. The images were recovered from the captured live site rather than guessed. The WordPress export XML does not carry these post bodies, so the crawl under mirror/ is the authoritative source, and it holds each gallery's nested figures in document order with their widths and captions. All 19 files were already on disk, so nothing was refetched. Three captions came back with them. Membership was not inferable from this repo, which is why the earlier note said so. It would also have been guessed wrong: the ESP32 gallery opens with a photo from 2018 and one from 2020, both older images reused in a 2021 post, where the obvious guess was the sequential camera run from that month. Two of the 19 were therefore already linked from their own original posts, which is why the orphan count falls by 17 rather than 19. A count comparison across all 19 posts holding galleries confirms the scope is these five and no others: every populated gallery matches the mirror exactly, and only the five empty ones differ. The comparison has a blind spot worth stating, since it produced a wrong answer first: a mirror page parsed as having fewer figures than the markdown means the parser missed that page's markup, not that images were lost, so only a surplus in the mirror is a finding. Regex could not read nested figures at all and reported a fictional 194-figure loss; the stdlib HTML parser gives the real 19. ORPHANED_MEDIA falls 120 -> 103 in the same change, which is the ratchet working rather than an edit alongside it: the gate failed at 120 and named 103. Verified on the mirror. assets rises 1012 -> 1031, matching the 19 restored references exactly; orphans falls to 103; PASS - 1245 URLs honored; the restored images answer 200; and the ESP32 gallery now renders four figures where it rendered none. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Restores missing image references inside previously-empty gallery shortcodes in imported Hugo post content, and updates the orphan-media baseline/notes so the URL-parity gate reflects the newly linked media.
Changes:
- Re-populates five previously-empty galleries across three posts with the correct
figureentries. - Updates
ORPHANED_MEDIAbaseline from 120 → 103 to reflect the restored references. - Refreshes
TODO.mdto reflect the reduced orphan count and the current investigation approach.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| TODO.md | Updates the open decision note to reflect the new orphan baseline (103) and current attribution plan. |
| content/posts/2022/10/31/halloween-pumpkins-and-lights.md | Restores 3 missing gallery images to the previously-empty gallery block. |
| content/posts/2022/10/30/installing-flair-smart-vents-to-keep-room-temperatures-balanced.md | Restores images into three previously-empty galleries within the post. |
| content/posts/2021/08/09/esp32-water-and-gas-utility-meter.md | Restores 4 images into the previously-empty gallery referenced by the post prose. |
| checks/check-url-parity.py | Lowers ORPHANED_MEDIA baseline to 103 and updates the accompanying explanation comment. |
This was referenced Aug 8, 2026
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.
Follow-up to #43, which added the gate that measures this. The gate reported 120 orphans; this restores 17 of them to the pages they belong on.
What was lost, and why
Five
galleryshortcodes across three posts were emitted empty. The ESP32 post announced:and then rendered
<div class="gallery gallery-cols-4"></div>.The cause is specific: WordPress used Gutenberg's
wp-block-gallerywith nested<figure>elements, andwp2hugowrote the wrapper while dropping what it wrapped.galleryis the only shortcode this happens to.Where the images came from
The captured live site, not a guess. The WordPress export XML does not carry these post bodies, so the crawl under
mirror/is the authoritative source. It holds each gallery's nested figures in document order, with their widths and captions. All 19 files were already on disk, so nothing was refetched, and three captions came back with them.Membership genuinely was not inferable from this repo — and it would have been guessed wrong. The ESP32 gallery opens with a photo from 2018 and one from 2020, older images reused in a 2021 post, where the obvious guess was the sequential camera run from that month. Those two were already linked from their own original posts, which is why the orphan count falls by 17, not 19.
Scope is exactly these five
A count comparison across all 19 posts holding galleries: every populated gallery matches the mirror exactly, and only the five empty ones differ.
[0][4][0,2,3,0,3,2,2,3,0,3,2][4,2,3,4,3,2,2,3,4,3,2][2,0,3,2][2,3,3,2]The comparison has a blind spot worth stating, because it produced a wrong answer first: a mirror page parsed as having fewer figures than the markdown means the parser missed that page's markup, not that images were lost. Only a surplus in the mirror is a finding. Regex could not read nested figures at all and reported a fictional 194-figure loss; the stdlib HTML parser gives the real 19.
The ratchet worked
ORPHANED_MEDIAfalls120 -> 103in this same change, because the gate demanded it rather than because I edited it alongside:That is #43 earning its place one PR after landing.
Verification
Released to the local mirror and checked live, since this touches
content/:assetsrises 1012 -> 1031, matching the 19 restored references exactly.orphansfalls to 103; parity PASS.PASS - 1245 URLs honored, rules confirmed from the release just installed.What remains
103 orphans, cause unknown per file — a mix of further conversion losses and uploads the old platform never published. This repo cannot tell those apart; the capture can, by generalizing the comparison above.
TODO.mdrecords that, along with the parser blind spot so the next attempt does not repeat the 194 mistake.One visible consequence to expect: the flair gallery at
cols="5"holds 4 images, so with the20%width from #41 it now occupies 80% of the row rather than filling it. That is the column count the author set in WordPress, andcolumns-5is what the mirror carries, so the markup is faithful.🤖 Generated with Claude Code