diff --git a/config/_default/params.toml b/config/_default/params.toml index c5d2631c..e36329e2 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -65,7 +65,7 @@ enableCodeCopy = true showAuthorsBadges = false showWordCount = true showSummary = true - sharingLinks = [ "linkedin", "twitter", "whatsapp", "pinterest", "reddit", "facebook", "email"] + sharingLinks = [ "linkedin", "twitter", "reddit", "pinterest", "facebook", "email"] [list] #showHero = true diff --git a/data/sharing.json b/data/sharing.json index 7a43b491..5c89852b 100644 --- a/data/sharing.json +++ b/data/sharing.json @@ -1,34 +1,32 @@ { - "links": { - "email": { - "icon": "email", - "title": "sharing.email", - "url": "mailto:?body=%s&subject=%s" - }, - "facebook": { - "icon": "facebook", - "title": "sharing.facebook", - "url": "https://www.facebook.com/sharer/sharer.php?u=%s"e=%s" - }, - "linkedin": { - "icon": "linkedin", - "title": "sharing.linkedin", - "url": "https://www.linkedin.com/shareArticle?mini=true&url=%s&title=%s" - }, - "pinterest": { - "icon": "pinterest", - "title": "sharing.pinterest", - "url": "https://pinterest.com/pin/create/bookmarklet/?url=%s&description=%s" - }, - "reddit": { - "icon": "reddit", - "title": "sharing.reddit", - "url": "https://reddit.com/submit/?url=%s&resubmit=true&title=%s" - }, - "twitter": { - "icon": "twitter", - "title": "sharing.twitter", - "url": "https://twitter.com/intent/tweet/?url=%s&text=%s" - } + "email": { + "icon": "email", + "title": "sharing.email", + "url": "mailto:?body=%s&subject=%s" + }, + "facebook": { + "icon": "facebook", + "title": "sharing.facebook", + "url": "https://www.facebook.com/sharer/sharer.php?u=%s"e=%s" + }, + "linkedin": { + "icon": "linkedin", + "title": "sharing.linkedin", + "url": "https://www.linkedin.com/shareArticle?mini=true&url=%s&title=%s" + }, + "pinterest": { + "icon": "pinterest", + "title": "sharing.pinterest", + "url": "https://pinterest.com/pin/create/bookmarklet/?url=%s&description=%s" + }, + "reddit": { + "icon": "reddit", + "title": "sharing.reddit", + "url": "https://reddit.com/submit/?url=%s&resubmit=true&title=%s" + }, + "twitter": { + "icon": "twitter", + "title": "sharing.twitter", + "url": "https://twitter.com/intent/tweet/?url=%s&text=%s" } -} +} \ No newline at end of file diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index 13d0d64c..efe3a93d 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -64,7 +64,7 @@ defaultBackgroundImage = "/img/iceland.jpg" showAuthorsBadges = true showWordCount = false showSummary = true - sharingLinks = [ "linkedin", "twitter", "whatsapp", "pinterest", "reddit", "facebook", "email"] + sharingLinks = [ "linkedin", "twitter", "reddit", "pinterest", "facebook", "email"] [list] showHero = true diff --git a/layouts/partials/sharing-links.html b/layouts/partials/sharing-links.html index 91365591..67b29235 100644 --- a/layouts/partials/sharing-links.html +++ b/layouts/partials/sharing-links.html @@ -1,16 +1,17 @@ {{ with .Params.sharingLinks | default (.Site.Params.article.sharingLinks | default false) }} + {{ $links := site.Data.sharing }}
- {{ range $.Site.Data.sharing.links }} - {{ with . }} - - {{ partial "icon.html" .icon }} - + {{ range . }} + {{ with index $links . }} + + {{ partial "icon.html" .icon }} + {{ end }} {{ end }}