diff --git a/data/sharing.json b/data/sharing.json index 32603fc6..6cda69ce 100644 --- a/data/sharing.json +++ b/data/sharing.json @@ -52,6 +52,6 @@ "mastodon": { "icon": "mastodon", "title": "sharing.mastodon", - "url": "https://share.joinmastodon.org/#text=%[2]s %[1]s" + "url": "https://share.joinmastodon.org/#text=%[2]s%%20%[1]s" } } diff --git a/layouts/partials/sharing-links.html b/layouts/partials/sharing-links.html index e235d650..c8e5bb5a 100644 --- a/layouts/partials/sharing-links.html +++ b/layouts/partials/sharing-links.html @@ -1,12 +1,16 @@ {{ with .Params.sharingLinks | default (.Site.Params.article.sharingLinks | default false) }} {{ $links := hugo.Data.sharing }} + {{ $pageURL := urlquery $.Permalink }} + {{ $pageTitle := urlquery $.Title }} + {{ $mastodonURL := replace $pageURL "+" "%20" }} + {{ $mastodonTitle := replace $pageTitle "+" "%20" }}
{{ range . }} {{ with index $links . }} {{ partial "icon.html" .icon }}