Skip to content

fix(hero): forward the cover flag into the hero body partial - #190

Merged
markdumay merged 1 commit into
mainfrom
fix/hero-cover-forwarding
Aug 2, 2026
Merged

fix(hero): forward the cover flag into the hero body partial#190
markdumay merged 1 commit into
mainfrom
fix/hero-cover-forwarding

Conversation

@markdumay

Copy link
Copy Markdown
Contributor

Found while investigating gethinode/hinode#2107.

Problem

hero.hugo.html passes cover to utilities/section.html but omits it from the assets/hero.html dict. So at assets/hero.html:158:

{{ if not $args.cover }}my-md-auto align-self-end{{ else }}hero-image-full-height{{ end }}

$args.cover always resolved to the structure default false. The hero-image-full-height branch was unreachable, and the SCSS added in 36701b5 ("fix(hero): add full-height image styling for cover sections", Feb 2026) had never applied to a rendered page.

None of the six callers of assets/hero.html passed cover.

Change

One line: forward cover. The hero structure already declares it.

What this actually does — less than the class name suggests

Measured in the Hinode exampleSite at 1900×1031 with cover: true:

  • Landscape illustrations: no change at all. Under object-fit: contain the width is already the binding dimension, so the rendered box is identical either way (428×241).
  • Portrait illustrations: contained instead of overflowing. 989px tall with the class; 1284px without, inflating the section to 1332px — past the intended cover height.

The reason it does so little: the section is d-flex align-items-center, so its inner container is centred rather than stretched. Every height: 100% in that SCSS resolves against a 292px content-sized row, never the 940px section. So the class is a guard against over-tall illustrations, not the "fill the full height" feature its name and commit message claim.

Worth shipping as-is — it's a real improvement for portrait images and the branch is meant to be reachable — but the naming and intent are worth a second look. I did not rename or redesign it; that's a layout change beyond this fix.

Scope

Hero only. about, featured, panels, contact-form, and contact compose assets/hero.html as a layout primitive with their own fixed orientation and width choices; forwarding cover there would silently change existing renders for blocks that never had the behavior.

npm test passes.

🤖 Generated with Claude Code

`hero.hugo.html` passed `cover` to `utilities/section.html` but omitted it
from the `assets/hero.html` dict, so `$args.cover` there always fell back
to the structure default of `false`. The `hero-image-full-height` branch
at `assets/hero.html:158` was therefore unreachable, and the SCSS block
added in 36701b5 had never applied to a rendered page.

Measured in the Hinode exampleSite at 1900x1031 with `cover: true`: the
illustration column now carries `hero-image-full-height` instead of
`my-md-auto align-self-end`. Landscape illustrations are unchanged --
under `object-fit: contain` their width is already the limiting
dimension. A portrait illustration is now contained within its column
(989px tall) instead of stretching the hero past the cover height
(1284px tall, inflating the section to 1332px).

Scoped to the hero block. The other five callers of `assets/hero.html`
(about, featured, panels, contact-form, contact) compose it as a layout
primitive with their own fixed orientation and width choices; forwarding
`cover` there would silently change existing renders for blocks that
never had the behavior.

Refs: gethinode/hinode#2107

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@markdumay

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 2.3.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@markdumay
markdumay deleted the fix/hero-cover-forwarding branch August 2, 2026 06:11
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