Skip to content

fix(directive-demos): tested-with param threading + image hotspot attr attachment - #3094

Merged
jung-thomas merged 1 commit into
DEVfrom
worktree-fix-demo-samples-render
Nov 10, 2026
Merged

jung-thomas merged 1 commit into
DEVfrom
worktree-fix-demo-samples-render

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

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 (and requires) were parsed → composed → 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 and my layout {{ with .Params.testedWith }} block rendered nothing. 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 — why the drop was invisible).

2. Image hotspots didn't attach

The prior PR's images.ts transform moves a standalone image's trailing {hotspots=…} to a block-attribute line. But that only reaches the image render hook's .Attributes when the image is not wrapped in a <p>. Verified with a local Hugo harness: default (wrapStandAloneImageWithinParagraph=true) → attr never attaches; false → 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.

Verification

Next

Merge → DEV rebuild of the demo slugs → final browser pass on tested-with panel + hotspot dots, then DEV→main→PROD.

…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
   (![](img)\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.
@jung-thomas
jung-thomas merged commit 25b3f45 into DEV Nov 10, 2026
4 checks passed
@jung-thomas
jung-thomas deleted the worktree-fix-demo-samples-render branch November 10, 2026 23:13
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.

1 participant