diff --git a/layouts/partials/share_icons.html b/layouts/partials/share_icons.html index b0c2f0a8..e1d40a77 100644 --- a/layouts/partials/share_icons.html +++ b/layouts/partials/share_icons.html @@ -1,8 +1,17 @@ {{- $pageurl := .Permalink }} {{- $title := .Title }} + +{{ $.Scratch.Set "tags" ""}} + +{{- with .Params.Tags }} +{{ $hashtags := newScratch}} +{{ range . }}{{ $hashtags.Add "tags" (slice (replaceRE "(\\s)" "" . ))}}{{end}} +{{ $.Scratch.Set "tags" (delimit ($hashtags.Get "tags") ",") }} +{{- end }} +
+ href="https://twitter.com/intent/tweet/?text={{ $title }}&url={{ $pageurl }}&hashtags={{- $.Scratch.Get "tags" -}}"> @@ -43,4 +52,4 @@ d="M26.49,29.86H5.5a3.37,3.37,0,0,1-2.47-1,3.35,3.35,0,0,1-1-2.47V5.48A3.36,3.36,0,0,1,3,3,3.37,3.37,0,0,1,5.5,2h21A3.38,3.38,0,0,1,29,3a3.36,3.36,0,0,1,1,2.46V26.37a3.35,3.35,0,0,1-1,2.47A3.38,3.38,0,0,1,26.49,29.86Zm-5.38-6.71a.79.79,0,0,0,.85-.66L24.73,9.24a.55.55,0,0,0-.18-.46.62.62,0,0,0-.41-.17q-.08,0-16.53,6.11a.59.59,0,0,0-.41.59.57.57,0,0,0,.43.52l4,1.24,1.61,4.83a.62.62,0,0,0,.63.43.56.56,0,0,0,.4-.17L16.54,20l4.09,3A.9.9,0,0,0,21.11,23.15ZM13.8,20.71l-1.21-4q8.72-5.55,8.78-5.55c.15,0,.23,0,.23.16a.18.18,0,0,1,0,.06s-2.51,2.3-7.52,6.8Z" /> -
\ No newline at end of file +