Skip to content

feat(link): forward skip-validation from the link shortcode to the partial#1959

Merged
markdumay merged 2 commits into
mainfrom
feat/link-skip-validation
Jun 22, 2026
Merged

feat(link): forward skip-validation from the link shortcode to the partial#1959
markdumay merged 2 commits into
mainfrom
feat/link-skip-validation

Conversation

@markdumay

Copy link
Copy Markdown
Collaborator

Summary

The assets/link.html partial has supported skip-validation since v2.0.0 (per data/structures/link.yml), but the {{< link >}} shortcode never forwarded it — so authors could not skip internal-link validation from markdown. This exposes the existing capability on the shortcode.

  • layouts/_shortcodes/link.html — forward "skip-validation" (index $args "skip-validation") into the assets/link.html partial call (hyphenated key read via index).
  • data/structures/link.yml — drop group: partial on skip-validation so the argument is recognized and auto-documented for the shortcode as well as the partial.

Use case: linking to build-time-dynamic targets (e.g. content-adapter / module-mounted pages that may be absent in a given build) without tripping the fatal internal-link validator.

Behavior

Backward compatible — skip-validation defaults to falsy, so omitting it leaves link behavior (and validation) unchanged.

Test

Verified against the exampleSite (internalLinks.validate = true, where an unresolved internal link is a fatal errorf) using a transient probe page linking to a non-existent internal path:

Case Cannot find page or asset errors
{{< link skip-validation=true >}} before the change 2 (not forwarded)
{{< link skip-validation=true >}} after the change 0 (skipped)
{{< link >}} (no arg) after the change 2 (default validation intact)

npm run lint:markdown passes; the probe page was removed before commit.

🤖 Generated with Claude Code

@markdumay markdumay changed the base branch from develop to main June 22, 2026 05:08
@netlify

netlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Deploy Preview for gethinode-demo ready!

Name Link
🔨 Latest commit 1cef2e5
🔍 Latest deploy log https://app.netlify.com/projects/gethinode-demo/deploys/6a38c3baf001a300083bb00b
😎 Deploy Preview https://deploy-preview-1959--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.

@markdumay markdumay enabled auto-merge June 22, 2026 05:12
@markdumay markdumay merged commit 10365b0 into main Jun 22, 2026
18 of 29 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.13.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@markdumay markdumay deleted the feat/link-skip-validation branch June 22, 2026 05:35
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