fix: honour an explicit cue/tab false on links, buttons and link lists - #2092
Merged
Conversation
Setting cue: false on an entry of a links list had no effect. Two separate defects sat in the way: assets/links.html forwarded title, icon, outline and order to assets/button.html but not cue, so the author's value never reached the consumer. It is forwarded on the button branch only; a download link is local by definition and download.html accepts no cue argument. assets/button.html and assets/link.html then resolved the value with '$args.cue | default site.Params.main.externalLinks.cue'. cue carries no schema default, so an absent value is nil and an explicit false is a deliberate choice — but Go's default treats false as empty and silently restored the site setting, defeating cue: false even when passed directly to either partial. Both now test for nil instead. The motivating case is a link that already carries its own brand icon, such as a LinkedIn button, where the external-link cue is redundant. Note tab has the same '| default' shape one line below in both partials and is left unchanged here. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Companion to the cue fix, with the same two defects. assets/links.html did not forward tab to assets/button.html, so tab: false on an entry of a links list never reached the consumer; it is forwarded on the button branch only, as download.html accepts no tab argument. assets/button.html and assets/link.html then resolved it with '$args.tab | default site.Params.main.externalLinks.tab'. tab carries no schema default, so an absent value is nil and an explicit false is a deliberate choice, but Go's default treats false as empty and restored the site setting — defeating tab: false even when passed directly. Both now test for nil. The motivating case is an external link that should stay in the current tab, such as a same-organisation destination on another host. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for gethinode-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
v6.8.4 declares cue and tab on the shared links item type (mod-utils#359), so
the attributes this PR starts forwarding no longer log warn-invalid-arguments
('unsupported attribute'). Not a functional dependency — the template changes
work on v6.8.3 — but without the floor a release could ship the working
overrides while still warning about them.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
🎉 This PR is included in version 3.11.6 🎉 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.
Setting
cue: falseortab: falseon an entry of a links list had no effect. Two independent defects sat in the way, and either one alone was enough to swallow the value.1.
assets/links.htmlnever forwarded them. It passestitle,icon,outlineandordertoassets/button.html, so the author'scue/tabnever reached the consumer. They are forwarded on the button branch only — a download link is local by definition anddownload.htmlaccepts neither argument.2.
| defaultswallowed an explicitfalse.assets/button.htmlandassets/link.htmlboth resolved the value with:Neither argument carries a schema default, so an absent value is
niland an explicitfalseis a deliberate choice — but Go'sdefaulttreatsfalseas empty and silently restored the site setting. This defeatedcue: falseeven when passed directly to either partial, not just through a links list. Both now test fornilinstead.The motivating cases are a link that already carries its own brand icon (a LinkedIn button, where the external-link cue is redundant) and an external link that should stay in the current tab.
Verification
assets/button.htmlandassets/link.html:cue: falseandtab: falseare now honoured, while links that set neither still get the cue icon andtarget="_blank"from the site defaults.cue: falseLinkedIn buttons go from 4/4 cued to 0/4 in both languages, a control set of external links stays 2/2 cued, and page counts and the rest of the build output are unchanged.exampleSiterenders clean.Dependency
Includes
build(deps): bump mod-utils to v6.8.4, which is where gethinode/mod-utils#359 landed — it declarescue/tabon the sharedlinksitem type so the attributes stop loggingwarn-invalid-arguments(unsupported attribute).Not a functional dependency: the template changes work on v6.8.3, which is why the earlier commits passed CI on their own. The floor is raised so a release cannot ship the working overrides while still warning about them.
exampleSitebuilds clean on v6.8.4 (98/26/24 pages, no new warnings).🤖 Generated with Claude Code