From 70a2b06ac15ee2f40320c9d4150f089ecbe833b1 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sun, 25 Oct 2020 13:57:03 +0530 Subject: [PATCH] share-icons: add #hashtag generation from tags for twitter share --- layouts/partials/share_icons.html | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 }} +
\ No newline at end of file +