Repository navigation
fix(sharing): encode share urls and add optional utm tags - #2336
Merged
Merged
Conversation
Share links are now built by utilities/GetShareURL.html. An opened provider gets {url}
and {title} query-escaped, with spaces as %20. Before, {url} went in unescaped, so a page
URL with a query string broke the provider's url parameter, and {title} carried spaces
as +. A clipboard provider still copies the raw page URL.
A new [sharing.utm] section, off by default, appends utm_source, utm_medium and
utm_campaign to the shared page URL. A provider sets utm_source through an optional
utm-source, defaulting to its anchorized name; the web share button uses
webshare-source. An empty campaign is left out.
The Twitter provider becomes X with the x.com post intent, and WhatsApp moves from the
whatsapp:// scheme to wa.me, in the theme and example site defaults.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No earlier case put a space into {url}, so none reached its %20 rewrite; this one does, with
a query string the provider must receive as one parameter. Also drop an unverified claim from
the GetShareURL comment about how every provider decodes %20.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Before this branch every provider had {title} replaced, a clipboard one included. The
clipboard branch of GetShareURL only replaced {url}, so a copied "{title}: {url}" kept a
literal {title}. It now gets the raw title, as it gets the raw url.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The copy-link provider is named "email" for its accessible label, so its UTM source defaulted to "email" and copied links would be reported as email traffic. It now sets utm-source = "clipboard" in the theme and example site defaults. The template tests read the theme's params.toml as data and assert the shipped provider. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rces The template tests now read the theme's params.toml and assert that UTM tagging ships disabled and that the X and WhatsApp urls are the intended ones. A two-word provider name is asserted to be anchorized, not only lowercased. The GetShareURL header now says source falls back to the webshare-source of the UTM settings in use, which a passed utm dict sets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Deploy Preview for gethinode-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
markdumay
enabled auto-merge
November 6, 2026 12:08
Collaborator
Author
|
🎉 This PR is included in version 3.52.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This was referenced Nov 6, 2026
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.
Closes #2329
Summary
Share links are now built by a new
utilities/GetShareURL.htmlpartial, called frompage/sharing.html.[sharing.utm]table (enabled,medium,campaign,webshare-source) appendsutm_source,utm_mediumandutm_campaignto the shared page URL. It is off by default, so no existing site changes its URLs on upgrade. Each provider may setutm-source; the default is its anchorized name, and the default copy-link provider usesclipboard.{url}and{title}are each query-escaped, with%20for spaces (never+). A page URL with a query string no longer breaks the provider'surl=parameter. Clipboard providers get the raw URL, so the copied link stays readable.https://x.com/intent/post?url={url}&text={title}. WhatsApp useshttps://wa.me/?text={title}%20{url}, which also works in a desktop browser without the app.Tests
tests/templates/layouts/_partials/tests/share-url.htmlasserts 24 rendered share URLs, covering:data-sharing-urlRed on
main, green on this branch.pnpm testpasses from a clean cache.The combined branch with #2330 passes the full suite. A downstream site built against it emits correctly encoded, UTM-tagged links for every provider, with no UTM in
og:url, the canonical URL or JSON-LD.Documentation follows in gethinode/docs (#2331).
🤖 Generated with Claude Code