social-share.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <!-- Check if any share-links are active -->
  2. {% assign any-share-links = false %}
  3. {% for links in site.share-links-active %}
  4. {% if links[1] == true %}
  5. {% assign any-share-links = true %}
  6. {% endif %}
  7. {% endfor %}
  8. {% if any-share-links %}
  9. <section id = "social-share-section">
  10. <span class="sr-only">Share: </span>
  11. {% if site.share-links-active.twitter %}
  12. <!--- Share on Twitter -->
  13. <a href="https://twitter.com/intent/tweet?text={{ page.title | url_encode }}&url={{ page.url | absolute_url | url_encode }}"
  14. class="btn btn-social-icon btn-twitter" title="Share on Twitter">
  15. <span class="fa fa-fw fa-twitter" aria-hidden="true"></span>
  16. <span class="sr-only">Twitter</span>
  17. </a>
  18. {% endif %}
  19. {% if site.share-links-active.facebook %}
  20. <!--- Share on Facebook -->
  21. <a href="https://www.facebook.com/sharer/sharer.php?u={{ page.url | absolute_url | url_encode }}"
  22. class="btn btn-social-icon btn-facebook" title="Share on Facebook">
  23. <span class="fa fa-fw fa-facebook" aria-hidden="true"></span>
  24. <span class="sr-only">Facebook</span>
  25. </a>
  26. {% endif %}
  27. {% if site.share-links-active.linkedin %}
  28. <!--- Share on LinkedIn -->
  29. <a href="https://www.linkedin.com/shareArticle?mini=true&url={{ page.url | absolute_url | url_encode }}"
  30. class="btn btn-social-icon btn-linkedin" title="Share on LinkedIn">
  31. <span class="fa fa-fw fa-linkedin" aria-hidden="true"></span>
  32. <span class="sr-only">LinkedIn</span>
  33. </a>
  34. {% endif %}
  35. </section>
  36. {% endif %}