From 42a23c96e26fa6b8d9eee0515e318c383e736bd1 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sat, 4 Sep 2021 13:10:35 +0530 Subject: [PATCH] Allow customizing Social-Media Share buttons Usage (site as well as fron-matter) => - `ShareButtons: ["linkedin", "twitter"]` - must be a list `[]` closes: #431 --- layouts/partials/share_icons.html | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/layouts/partials/share_icons.html b/layouts/partials/share_icons.html index 73f525a9..85c59b3b 100644 --- a/layouts/partials/share_icons.html +++ b/layouts/partials/share_icons.html @@ -4,12 +4,17 @@ {{- $.Scratch.Set "tags" ""}} {{- with .Params.Tags }} -{{ $hashtags := newScratch}} +{{- $hashtags := newScratch}} {{- range . }}{{ $hashtags.Add "tags" (slice (replaceRE "(\\s)" "" . ))}}{{end}} {{- $.Scratch.Set "tags" (delimit ($hashtags.Get "tags") ",") }} {{- end -}} +{{- $custom := false }} +{{- $ShareButtons := (.Param "ShareButtons")}} +{{- with $ShareButtons }}{{ $custom = true }}{{ end }} +