feat(link): forward skip-validation from the link shortcode to the partial#1959
Merged
Conversation
✅ Deploy Preview for gethinode-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
🎉 This PR is included in version 2.13.0 🎉 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.
Summary
The
assets/link.htmlpartial has supportedskip-validationsince v2.0.0 (perdata/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 theassets/link.htmlpartial call (hyphenated key read viaindex).data/structures/link.yml— dropgroup: partialonskip-validationso 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-validationdefaults 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 fatalerrorf) using a transient probe page linking to a non-existent internal path:Cannot find page or asseterrors{{< link skip-validation=true >}}before the change{{< link skip-validation=true >}}after the change{{< link >}}(no arg) after the changenpm run lint:markdownpasses; the probe page was removed before commit.🤖 Generated with Claude Code