social-share.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. <a href="https://twitter.com/intent/tweet?text={{ page.title | strip_html | url_encode }}&url={{ page.url | absolute_url | url_encode }}"
  13. class="btn btn-social-icon btn-twitter" title="Share on X (Twitter)">
  14. <span class="fab fa-fw fa-x-twitter" aria-hidden="true"></span>
  15. <span class="sr-only">X (Twitter)</span>
  16. </a>
  17. {% endif %}
  18. {% if site.share-links-active.facebook %}
  19. <a href="https://www.facebook.com/sharer/sharer.php?u={{ page.url | absolute_url | url_encode }}"
  20. class="btn btn-social-icon btn-facebook" title="Share on Facebook">
  21. <span class="fab fa-fw fa-facebook" aria-hidden="true"></span>
  22. <span class="sr-only">Facebook</span>
  23. </a>
  24. {% endif %}
  25. {% if site.share-links-active.linkedin %}
  26. <a href="https://www.linkedin.com/shareArticle?mini=true&url={{ page.url | absolute_url | url_encode }}"
  27. class="btn btn-social-icon btn-linkedin" title="Share on LinkedIn">
  28. <span class="fab fa-fw fa-linkedin" aria-hidden="true"></span>
  29. <span class="sr-only">LinkedIn</span>
  30. </a>
  31. {% endif %}
  32. {% if site.share-links-active.vk %}
  33. <a href="https://vk.com/share.php?url={{ page.url | absolute_url | url_encode }}"
  34. class="btn btn-social-icon btn-vk" title="Share on VK">
  35. <span class="fab fa-fw fa-vk" aria-hidden="true"></span>
  36. <span class="sr-only">VK</span>
  37. </a>
  38. {% endif %}
  39. {% if site.share-links-active.reddit %}
  40. <a href="https://www.reddit.com/submit?url={{ page.url | absolute_url | url_encode }}"
  41. class="btn btn-social-icon btn-reddit" title="Share on Reddit">
  42. <span class="fab fa-fw fa-reddit" aria-hidden="true"></span>
  43. <span class="sr-only">Reddit</span>
  44. </a>
  45. {% endif %}
  46. </section>
  47. {% endif %}