fix: declare label and url attributes on the elements item type - #357
Merged
Conversation
Components render element.label and element.url — mod-blocks' cards
component uses label as the card's button label, and downstream themes
use label/url for element links — but the shared elements item type does
not declare them. The v6 validation engine therefore logs
warn-invalid-arguments ('unsupported attribute') on every render of
content that legitimately uses these attributes.
Both attributes have global definitions in _arguments.yml (label via the
messages type, url via links), so the members compile without further
changes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Collaborator
Author
|
🎉 This PR is included in version 6.8.2 🎉 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.
Problem
Components read
element.labelandelement.urlfromelements-typed arguments — mod-blocks'cardscomponent renders.labelas the card's button label (cards.hugo.html), and theme components uselabel/urlfor element links — but the sharedelementsitem type indata/structures/_types.ymldoes not declare either attribute.The v6 validation engine validates list items against this type registry (inline item schemas in per-structure files are not consulted for typed arguments), so any content that legitimately uses these attributes logs
warn-invalid-arguments: unsupported attributeon every render. On a production site upgraded to the v3 generation this produced ~200 warnings per build for content that renders correctly. These warnings are slated to become errors in a future major, so the gap would eventually break valid sites.Fix
Add
label:andurl:to theelementsitem type. Both already have global definitions in_arguments.yml(labelvia themessagestype,urlvialinks), so the members compile without further changes.Verification
npm test: golden check passed (13 groups), no golden changes (the suite exercises the engine against the exampleSite fixture types, not the shipped registry).unsupported attribute 'label'/'url'warnings while the cards/hero elements keep rendering identically.🤖 Generated with Claude Code