diff options
author | Dudi Levy <4785835+dudil@users.noreply.github.com> | 2018-02-12 01:15:26 +0300 |
---|---|---|
committer | Patrick Collins <thepatrickcollins@gmail.com> | 2018-02-12 01:15:26 +0300 |
commit | 187e213d406e03aa8cc2fa755231433c5f5aa083 (patch) | |
tree | 4e191009d0d6b653d378c3407f81b769ff8a90ec | |
parent | 60201d39d2a16fdaef8e3b0d9a180263ee7278c3 (diff) |
Add the possibility to set only specific social networks to share the post (#112)
-rw-r--r-- | exampleSite/config.toml | 10 | ||||
-rw-r--r-- | layouts/partials/share-links.html | 17 |
2 files changed, 27 insertions, 0 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index faee664..001ccd4 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -39,6 +39,16 @@ pluralizeListTitles = false faviconVersion = "" # Sets Social Share links to appear on posts socialShare = true + # Sets specific share to appear on posts (default behavior is to appear) + socialShareTwitter = true + socialShareGoogleplus = true + socialShareFacebook = true + socialShareReddit = true + socialShareLinkedin = true + socialShareStumbleupon = true + socialSharePinterest = true + socialShareEmail = true + # Load custom CSS or JavaScript files. The variable is an array so that you # can load multiple files if necessary. You can also load the standard theme # files by adding the value, "default". diff --git a/layouts/partials/share-links.html b/layouts/partials/share-links.html index 236dc38..ef1d96c 100644 --- a/layouts/partials/share-links.html +++ b/layouts/partials/share-links.html @@ -1,65 +1,82 @@ <!-- Social Share Button HTML --> <!-- Twitter --> +{{ if .Site.Params.socialShareTwitter | default true}} <li> <a href="//twitter.com/share?url={{ .Permalink }}&text={{ .Title }}&via={{ .Site.Social.twitter }}" target="_blank" class="share-btn twitter"> <i class="fa fa-twitter"></i> <p>Twitter</p> </a> </li> +{{ end }} <!-- Google Plus --> +{{ if .Site.Params.socialShareGoogleplus | default true}} <li> <a href="//plus.google.com/share?url={{ .Permalink }}" target="_blank" class="share-btn google-plus"> <i class="fa fa-google-plus"></i> <p>Google+</p> </a> </li> +{{ end }} <!-- Facebook --> +{{ if .Site.Params.socialShareFacebook | default true}} + <li> <a href="//www.facebook.com/sharer/sharer.php?u={{ .Permalink }}" target="_blank" class="share-btn facebook"> <i class="fa fa-facebook"></i> <p>Facebook</p> </a> </li> +{{ end }} <!-- Reddit --> +{{ if .Site.Params.socialShareReddit | default true}} <li> <a href="//reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}" target="_blank" class="share-btn reddit"> <i class="fa fa-reddit-alien"></i> <p>Reddit</p> </a> </li> +{{ end }} <!-- LinkedIn --> +{{ if .Site.Params.socialShareLinkedin | default true}} <li> <a href="//www.linkedin.com/shareArticle?url={{ .Permalink }}&title={{ .Title }}" target="_blank" class="share-btn linkedin"> <i class="fa fa-linkedin"></i> <p>LinkedIn</p> </a> </li> +{{ end }} <!-- StumbleUpon --> +{{ if .Site.Params.socialShareStumbleupon | default true}} <li> <a href="//www.stumbleupon.com/submit?url={{ .Permalink }}&title={{ .Title }}" target="_blank" class="share-btn stumbleupon"> <i class="fa fa-stumbleupon"></i> <p>StumbleUpon</p> </a> </li> +{{ end }} <!-- Pintrest --> +{{ if .Site.Params.socialSharePinterest | default true}} <li> <a href="//www.pinterest.com/pin/create/button/?url={{ .Permalink }}&description={{ .Title }}" target="_blank" class="share-btn pinterest"> <i class="fa fa-pinterest-p"></i> <p>Pinterest</p> </a> </li> +{{ end }} <!-- Email --> +{{ if .Site.Params.socialShareEmail | default true}} <li> <a href="mailto:?subject=Check out this post by {{ .Params.author }}&body={{ .Permalink }}" target="_blank" class="share-btn email"> <i class="fa fa-envelope"></i> <p>Email</p> </a> </li> +{{ end }} |