Skip to content

feat: thread owning page and embed flag through content blocks (render-once D4)#163

Merged
markdumay merged 1 commit into
mainfrom
feat/render-once-d4-page-threading
Jul 16, 2026
Merged

feat: thread owning page and embed flag through content blocks (render-once D4)#163
markdumay merged 1 commit into
mainfrom
feat/render-once-d4-page-threading

Conversation

@markdumay

Copy link
Copy Markdown
Contributor

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

  • page/blocks.html — accepts legacy page context or a (dict "page" . "embed" bool);
    injects _page (and _embed when given) into every block dict alongside _ordinal.
  • All 19 components — adopt {{ $page := or ._page page }} and use $page for every
    former global-page read (the "page" argument fills, RenderString, IsHome/IsPage/Params/Title).
    Injected props are stripped before Args.html validation so they don't leak into rendered
    {{< args >}} doc tables or the search index (sidecar-schema route rejected for that reason).
  • utilities/section.html — explicit page/embed args; blocks_embed Scratch read kept as
    deprecated fallback for one release (dropped in D9); overlayMode reads → $page.Params.
  • assets/hero.html / faq.html / preview.html / testimonial-carousel.html — accept/thread the
    page argument from component callers.
  • AddModule call sites pass the resolved page (mod-utils ≥6.6.0 dual-writes it to Store).
  • list.hugo.html — breakpoint re-seed workaround removed (zero remaining readers).

Compatibility

Fully backward-compatible with current hinode (v3.2.7): with an unpatched hinode the or ._page page fallback preserves today's behavior byte-for-byte. The hinode follow-up (held PR) starts
threading _page/embed after this releases.

Gate evidence (byte-diff, hinode exampleSite @ 50b5612b, hugo v0.164.0)

  • Stock hinode + this branch (replacement): candidate-vs-stock zero-diff (only the 3 allowlisted
    RSS files); run-vs-run clean; 0 ERROR, 98/26/24 pages, WARN set unchanged; docs/blocks pages
    byte-identical incl. the px-0 embed path.
  • Independently re-verified by the program driver.
  • mod-blocks pnpm test (exampleSite build) green.

Releases as v2.2.0.

🤖 Generated with Claude Code

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>
@markdumay markdumay merged commit da901aa into main Jul 16, 2026
8 checks passed
@markdumay

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 2.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant