Skip to content

fix: declare label and url attributes on the elements item type - #357

Merged
markdumay merged 2 commits into
mainfrom
fix/elements-type-label-url
Jul 28, 2026
Merged

fix: declare label and url attributes on the elements item type#357
markdumay merged 2 commits into
mainfrom
fix/elements-type-label-url

Conversation

@markdumay

@markdumay markdumay commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Problem

Components read element.label and element.url from elements-typed arguments — mod-blocks' cards component renders .label as the card's button label (cards.hugo.html), and theme components use label/url for element links — but the shared elements item type in data/structures/_types.yml does 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 attribute on 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: and url: to the elements item type. Both already have global definitions in _arguments.yml (label via the messages type, url via links), 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).
  • The identical change applied as a site shadow removes all unsupported attribute 'label'/'url' warnings while the cards/hero elements keep rendering identically.

🤖 Generated with Claude Code

markdumay and others added 2 commits July 28, 2026 11:22
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>
@markdumay
markdumay enabled auto-merge July 28, 2026 09:31
@markdumay
markdumay merged commit 883ed63 into main Jul 28, 2026
11 checks passed
@markdumay
markdumay deleted the fix/elements-type-label-url branch July 28, 2026 09:33
@markdumay

Copy link
Copy Markdown
Collaborator Author

🎉 This PR is included in version 6.8.2 🎉

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