From e0b08519c9f27e8763d1e725517e095899f905fa Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Mon, 27 Jul 2020 14:27:38 +0530 Subject: [PATCH] add Share Buttons use Params.ShowShareButtons = true credits : https://www.iconfinder.com/iconsets/social-media-rounded-corners License: Free for commercial use --- assets/css/post-single.css | 16 +++++++++ layouts/_default/single.html | 3 ++ layouts/partials/share-icons.html | 54 +++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 layouts/partials/share-icons.html diff --git a/assets/css/post-single.css b/assets/css/post-single.css index 60937fb..f676d5b 100644 --- a/assets/css/post-single.css +++ b/assets/css/post-single.css @@ -253,4 +253,20 @@ .post-tags a:hover { background: var(--border); +} + +.share-buttons { + fill: currentColor; + margin: 4px 0; + text-align: center; + background: var(--code-bg); + border-radius: var(--radius); + margin-top: 24px; +} + +.share-button-single svg { + fill: currentColor; + height: 30px; + width: 30px; + margin: 0 10px; } \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 8ba8fc6..625bafb 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -33,6 +33,9 @@
  • {{ . }}
  • {{- end }} + {{ if .Site.Params.ShowShareButtons }} + {{ partial "share-icons.html" . }} + {{ end }} {{- end }} diff --git a/layouts/partials/share-icons.html b/layouts/partials/share-icons.html new file mode 100644 index 0000000..f3f1312 --- /dev/null +++ b/layouts/partials/share-icons.html @@ -0,0 +1,54 @@ +{{ $pageurl := .Permalink }} +{{ $title := .Title }} +
    +

    Share On

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    \ No newline at end of file