feat: thread owning page and embed flag through content blocks (render-once D4)#163
Merged
Merged
Conversation
Inject the owning page (_page) and optional embed flag (_embed) into each block dict in page/blocks.html, which now also accepts a dict with page and embed arguments. Components resolve the page once via 'or ._page page' and use it for all global-page reads and page argument fills; the injected props are excluded from args validation. utilities/section.html gains explicit page and embed arguments; the blocks_embed scratch fallback stays one release. assets/hero, assets/faq, assets/preview and assets/testimonial-carousel accept a threaded page argument. AddModule receives the resolved page. Drop the list.hugo.html breakpoint re-seed workaround. Part of the render-once program (slice D4). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
🎉 This PR is included in version 2.2.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Render-once program — slice D4, module side
Part of the Hinode render-once implementation program (design:
gethinode.com
docs/superpowers/specs/2026-07-15-content-render-once-design.md§4.2/§6-D4).Changes
(dict "page" . "embed" bool);injects
_page(and_embedwhen given) into every block dict alongside_ordinal.{{ $page := or ._page page }}and use$pagefor everyformer global-
pageread (the "page" argument fills, RenderString, IsHome/IsPage/Params/Title).Injected props are stripped before
Args.htmlvalidation so they don't leak into rendered{{< args >}}doc tables or the search index (sidecar-schema route rejected for that reason).page/embedargs;blocks_embedScratch read kept asdeprecated fallback for one release (dropped in D9);
overlayModereads →$page.Params.pageargument from component callers.Compatibility
Fully backward-compatible with current hinode (v3.2.7): with an unpatched hinode the
or ._page pagefallback preserves today's behavior byte-for-byte. The hinode follow-up (held PR) startsthreading
_page/embedafter this releases.Gate evidence (byte-diff, hinode exampleSite @ 50b5612b, hugo v0.164.0)
RSS files); run-vs-run clean; 0 ERROR, 98/26/24 pages, WARN set unchanged; docs/blocks pages
byte-identical incl. the
px-0embed path.pnpm test(exampleSite build) green.Releases as v2.2.0.
🤖 Generated with Claude Code