From 0c36cdca45f63caad8834b89ebb93a1c3e2b6ba3 Mon Sep 17 00:00:00 2001 From: Cassio Batista Date: Sat, 15 Jun 2019 13:23:08 -0300 Subject: [PATCH] feat(page): enable page sharing buttons to be customized To customise sharing buttons, override `themes/academic/data/page_sharer.toml` by copying the file to `data/page_sharer.toml` at the root of a site and editing the copy. Close #1108 Close #1131 --- data/page_sharer.toml | 55 +++++++++++++++++++++++++++++++++++++ layouts/partials/share.html | 48 ++++++++++---------------------- 2 files changed, 69 insertions(+), 34 deletions(-) create mode 100644 data/page_sharer.toml diff --git a/data/page_sharer.toml b/data/page_sharer.toml new file mode 100644 index 00000000..6cfc5219 --- /dev/null +++ b/data/page_sharer.toml @@ -0,0 +1,55 @@ +[[buttons]] + id = "twitter" + url = "https://twitter.com/intent/tweet?url={url}&text={title}" + title = "Twitter" + icon_pack = "fab" + icon = "twitter" + enable = true + +[[buttons]] + id = "facebook" + url = "https://www.facebook.com/sharer.php?u={url}&t={title}" + title = "Facebook" + icon_pack = "fab" + icon = "facebook-f" + enable = true + +[[buttons]] + id = "email" + url = "mailto:?subject={title}&body={url}" + title = "Email" + icon_pack = "fas" + icon = "envelope" + enable = true + +[[buttons]] + id = "linkedin" + url = "https://www.linkedin.com/shareArticle?url={url}&title={title}" + title = "LinkedIn" + icon_pack = "fab" + icon = "linkedin-in" + enable = true + +[[buttons]] + id = "whatsapp" + url = "https://web.whatsapp.com/send?text={title}%20{url}" + title = "WhatsApp" + icon_pack = "fab" + icon = "whatsapp" + enable = true + +[[buttons]] + id = "weibo" + url = "https://service.weibo.com/share/share.php?url={url}&title={title}" + title = "Weibo" + icon_pack = "fab" + icon = "weibo" + enable = true + +[[buttons]] + id = "reddit" + url = "https://reddit.com/submit?url={url}&title={title}" + title = "Reddit" + icon_pack = "fab" + icon = "reddit-alien" + enable = false diff --git a/layouts/partials/share.html b/layouts/partials/share.html index 1ee30181..979c3750 100644 --- a/layouts/partials/share.html +++ b/layouts/partials/share.html @@ -1,40 +1,20 @@ {{ if and site.Params.sharing (ne .Params.share false) }} {{ end }}