Repository navigation
fix(directive-demos): tested-with param threading + image hotspot attr attachment - #3094
Merged
Merged
Conversation
…ge hotspot attrs
Two remaining demo breakages, both root-caused by live DEV inspection + a local
Hugo render harness (not HTML grep):
1. Tested-with panel never populated: testedWith (and requires) were parsed,
composed, and ACCEPTED by renderHugoFrontmatter (render-frontmatter.ts:114/
120/274-275) — but writeHugoPage() in fetch-tutorials.ts never forwarded them
from the composed result, so .Params.testedWith was always empty. Added both
to the writeHugoPage signature, the renderHugoFrontmatter call, and the fetch
call site. +4 regression tests asserting the rendered frontmatter carries them
(the only prior testedWith test covered freshness-checking, not generation —
which is why the drop was invisible).
2. Image hotspots: a standalone image's following block-attribute line
(\n{hotspots=…}, produced by the images.ts transform in the prior
commit) only reaches the image render hook's .Attributes when the image is NOT
wrapped in a <p>. Verified with a local Hugo 0.147 harness: with
wrapStandAloneImageWithinParagraph at its default (true) the attr never
attaches; set false and render-image.html emits .tut-hotspot-wrap +
data-hotspots + 3 .tut-hotspot anchors. Set the flag in hugo.toml. No CSS
depends on p>img (checked); render hooks already emit their own wrappers.
Verified end-to-end in a local Hugo render; 4/4 new tests pass.
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.
Summary
Final two demo breakages (verified via live DEV devtools + a local Hugo 0.147 render harness — the method that actually catches these, unlike HTML grep):
1. "Tested with" panel never populated
testedWith(andrequires) were parsed → composed → accepted byrenderHugoFrontmatter(render-frontmatter.ts:114/120/274-275), butwriteHugoPage()infetch-tutorials.tsnever forwarded them from the composed result. So.Params.testedWithwas always empty and my layout{{ with .Params.testedWith }}block rendered nothing. Added both to thewriteHugoPagesignature, therenderHugoFrontmattercall, and the fetch call site. +4 regression tests asserting the rendered frontmatter carries them (the only priortestedWithtest covered freshness-checking, not generation — why the drop was invisible).2. Image hotspots didn't attach
The prior PR's
images.tstransform moves a standalone image's trailing{hotspots=…}to a block-attribute line. But that only reaches the image render hook's.Attributeswhen the image is not wrapped in a<p>. Verified with a local Hugo harness: default (wrapStandAloneImageWithinParagraph=true) → attr never attaches;false→render-image.htmlemits.tut-hotspot-wrap+data-hotspots+ 3.tut-hotspotanchors. Set the flag inhugo.toml. No CSS depends onp>img(checked); render hooks already emit their own wrappers.Verification
position:static, input docked in the 420px panel)Next
Merge → DEV rebuild of the demo slugs → final browser pass on tested-with panel + hotspot dots, then DEV→main→PROD.