Skip to content

feat(arguments): add heading-level and heading-class - #361

Merged
markdumay merged 1 commit into
mainfrom
feat/heading-level-arguments
Aug 5, 2026
Merged

feat(arguments): add heading-level and heading-class#361
markdumay merged 1 commit into
mainfrom
feat/heading-level-arguments

Conversation

@markdumay

Copy link
Copy Markdown
Collaborator

What

Defines heading-level and heading-class once, so consuming structures and component blueprints can reference them by bare key.

Why

hinode v3.19.0 introduced both arguments as full inline definitions in data/structures/section-title.yml, and gethinode/mod-blocks#193 repeats the same six-line block in twelve component sidecars plus hero.yml and preview.yml. use-title — the boolean heading-level replaces — has always been a single entry here, referenced by bare key everywhere. These belong in the same place.

heading-class also joins an established family of shared arguments: bg-class, icon-class, section-class and figclass are all defined here already.

Deliberately no default

Neither argument carries a default:. Consuming partials distinguish three states:

heading-level meaning
unset (nil) inherit a level from the caller, or fall back to the legacy use-title boolean
0 render a div
16 render h1h6

A default: 0 would collapse the first two, so use-title: true would silently stop producing an h1. InitArgs omits unset arguments from its result map, which is what keeps the distinction intact.

Also deliberately no min/max

The args engine supports options: {min, max} for int and raises an error at depth 0. hinode v3.19.0 instead warns and falls back to a div for an out-of-range level. Declaring a range here would convert that shipped behaviour into a build failure, and would turn a typo in author front matter into a red build, so this leaves the existing contract alone. Worth deciding separately if the stricter behaviour is preferred.

Verification

  • hugo -s exampleSite clean, node tests/golden.mjs passes (14 groups).
  • Resolved end to end against a hinode branch that reduces section-title.yml to release-only overrides (gethinode/hinode#TBD), through a workspace use. All six argument shapes render byte-identically to shipped v3.19.0: unset → div, use-title: trueh1 with no reset, level 2 → h2 with the reset, explicit 0div, level 1 with an empty heading-classh1 with no extra classes, and level 9 → warns and falls back to div.

🤖 Generated with Claude Code

Both arguments were introduced inline by hinode v3.19.0 and repeated in
every consuming component sidecar. Define them once here so consumers can
reference them by bare key, as they already do for use-title.

Neither carries a default: consuming partials distinguish an unset level
(inherit or fall back to the legacy use-title boolean) from an explicit 0
(render a div), so a default would collapse that distinction.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@markdumay
markdumay merged commit 4c4b26f into main Aug 5, 2026
11 checks passed
@markdumay

Copy link
Copy Markdown
Collaborator Author

🎉 This PR is included in version 6.9.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@markdumay
markdumay deleted the feat/heading-level-arguments branch August 5, 2026 13:32
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