diff --git a/_config.yml b/_config.yml index 6e69e228a0..7675d6694b 100644 --- a/_config.yml +++ b/_config.yml @@ -111,7 +111,11 @@ JB : # Set 'provider' to false to turn sharing off globally. # sharing : - provider : false + enabled : true + provider : + twitter : true + facebook : true + google-plus: true # Settings for all other include helpers can be defined by creating # a hash with key named for the given helper. ex: diff --git a/_includes/JB/sharing b/_includes/JB/sharing index f5b11518bd..0f374556eb 100644 --- a/_includes/JB/sharing +++ b/_includes/JB/sharing @@ -1,8 +1,41 @@ -{% if site.safe and site.JB.sharing.provider and page.JB.sharing != false %} +{% comment %}{% endcomment %} -{% endif %} \ No newline at end of file +{% if site.JB.sharing.enabled %} + + {% if sharing_context %} + {% assign page = sharing_context %} + {% endif %} + + {% capture sharing_url %}{{ site.production_url }}{{ page.url }}/{% endcapture %} + {% capture sharing_prefix %}Share "{{ page.title }}" on{% endcapture %} + + {% if site.JB.sharing.provider.twitter %} + {% capture sharing_title %}{{ sharing_prefix }} Twitter{% endcapture %} + {% include JB/sharing-providers/twitter %} + {% endif %} + {% if site.JB.sharing.provider.facebook %} + {% capture sharing_title %}{{ sharing_prefix }} Facebook{% endcapture %} + {% include JB/sharing-providers/facebook %} + {% endif %} + {% if site.JB.sharing.provider.google-plus %} + {% capture sharing_title %}{{ sharing_prefix }} Google Plus{% endcapture %} + {% include JB/sharing-providers/google-plus %} + {% endif %} + +{% endif %} diff --git a/_includes/JB/sharing-providers/facebook b/_includes/JB/sharing-providers/facebook new file mode 100644 index 0000000000..cf0b523d96 --- /dev/null +++ b/_includes/JB/sharing-providers/facebook @@ -0,0 +1,3 @@ +
  • + diff --git a/_includes/JB/sharing-providers/google-plus b/_includes/JB/sharing-providers/google-plus new file mode 100644 index 0000000000..a65ed16cfc --- /dev/null +++ b/_includes/JB/sharing-providers/google-plus @@ -0,0 +1,3 @@ +
  • + diff --git a/_includes/JB/sharing-providers/twitter b/_includes/JB/sharing-providers/twitter new file mode 100644 index 0000000000..1e7cdc630f --- /dev/null +++ b/_includes/JB/sharing-providers/twitter @@ -0,0 +1,5 @@ +
  • +