Skip to content

fix: honour an explicit cue/tab false on links, buttons and link lists - #2092

Merged
markdumay merged 3 commits into
mainfrom
fix/links-cue-forwarding
Jul 30, 2026
Merged

fix: honour an explicit cue/tab false on links, buttons and link lists#2092
markdumay merged 3 commits into
mainfrom
fix/links-cue-forwarding

Conversation

@markdumay

@markdumay markdumay commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Setting cue: false or tab: false on 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.html never forwarded them. It passes title, icon, outline and order to assets/button.html, so the author's cue/tab never reached the consumer. They are forwarded on the button branch only — a download link is local by definition and download.html accepts neither argument.

2. | default swallowed an explicit false. assets/button.html and assets/link.html both resolved the value with:

{{- $cue := $args.cue | default site.Params.main.externalLinks.cue -}}

Neither argument carries a 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. This defeated cue: false even when passed directly to either partial, not just through a links list. Both now test for nil instead.

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

  • Direct probe against assets/button.html and assets/link.html: cue: false and tab: false are now honoured, while links that set neither still get the cue icon and target="_blank" from the site defaults.
  • Applied to a production multilingual site on hinode v3.11.5: the four cue: false LinkedIn 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.
  • exampleSite renders clean.

Dependency

Includes build(deps): bump mod-utils to v6.8.4, which is where gethinode/mod-utils#359 landed — it declares cue/tab on the shared links item type so the attributes stop logging warn-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. exampleSite builds clean on v6.8.4 (98/26/24 pages, no new warnings).

🤖 Generated with Claude Code

markdumay and others added 2 commits July 29, 2026 20:42
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>
@netlify

netlify Bot commented Jul 29, 2026

Copy link
Copy Markdown

Deploy Preview for gethinode-demo ready!

Name Link
🔨 Latest commit 4821c01
🔍 Latest deploy log https://app.netlify.com/projects/gethinode-demo/deploys/6a6acd6ed1dcfb00088ea4f7
😎 Deploy Preview https://deploy-preview-2092--gethinode-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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>
@markdumay
markdumay merged commit 2dc4c97 into main Jul 30, 2026
17 checks passed
@markdumay
markdumay deleted the fix/links-cue-forwarding branch July 30, 2026 04:11
@markdumay

Copy link
Copy Markdown
Collaborator Author

🎉 This PR is included in version 3.11.6 🎉

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