From 8c75ca4ecbdd23c5353ee67896cc0d9c2e3f4b71 Mon Sep 17 00:00:00 2001 From: Tommy Date: Fri, 22 Jul 2022 18:59:26 -0400 Subject: [PATCH] Add Share Buttons Signed-off-by: Tommy --- assets/css/extended/custom.css | 5 +++ config.yml | 1 + layouts/partials/share_icons.html | 62 +++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 layouts/partials/share_icons.html diff --git a/assets/css/extended/custom.css b/assets/css/extended/custom.css index 47db37e..d5126e2 100644 --- a/assets/css/extended/custom.css +++ b/assets/css/extended/custom.css @@ -5,4 +5,9 @@ .paginav a:hover { background: none; +} + +.share-buttons { + background: none; + border: none; } \ No newline at end of file diff --git a/config.yml b/config.yml index 3b7d448..3e0f7ad 100644 --- a/config.yml +++ b/config.yml @@ -23,6 +23,7 @@ params: ShowToc: true ShowRssButtonInSectionTermList: true ShowCodeCopyButtons: true + ShowShareButtons: true assets: # disableHLJS: true # to disable highlight.js diff --git a/layouts/partials/share_icons.html b/layouts/partials/share_icons.html new file mode 100644 index 0000000..ee80a2b --- /dev/null +++ b/layouts/partials/share_icons.html @@ -0,0 +1,62 @@ +{{- $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 -}} + +{{- $custom := false }} +{{- $ShareButtons := (.Param "ShareButtons")}} +{{- with $ShareButtons }}{{ $custom = true }}{{ end }} + + \ No newline at end of file