feat(arguments): add heading-level and heading-class - #361
Merged
Conversation
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>
This was referenced Aug 5, 2026
Collaborator
Author
|
🎉 This PR is included in version 6.9.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.
What
Defines
heading-levelandheading-classonce, 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 plushero.ymlandpreview.yml.use-title— the booleanheading-levelreplaces — has always been a single entry here, referenced by bare key everywhere. These belong in the same place.heading-classalso joins an established family of shared arguments:bg-class,icon-class,section-classandfigclassare all defined here already.Deliberately no default
Neither argument carries a
default:. Consuming partials distinguish three states:heading-leveluse-titleboolean0div1–6h1–h6A
default: 0would collapse the first two, souse-title: truewould silently stop producing anh1.InitArgsomits 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}forintand raises an error at depth 0. hinode v3.19.0 instead warns and falls back to adivfor 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 exampleSiteclean,node tests/golden.mjspasses (14 groups).section-title.ymlto release-only overrides (gethinode/hinode#TBD), through a workspaceuse. All six argument shapes render byte-identically to shipped v3.19.0: unset →div,use-title: true→h1with no reset, level 2 →h2with the reset, explicit0→div, level 1 with an emptyheading-class→h1with no extra classes, and level 9 → warns and falls back todiv.🤖 Generated with Claude Code