Sharing to social media using simple links
Allowing visitors to share pages to social media is a good way of disseminating information. The issue with the recommended methods โ embedded buttons โ is that they rely on adding a script to each page, which can slow down page loading or track usage across websites. HTML hyperlinks are universally supported and provide an easy way for visitors to create a post directly.
The GitHub Pages backend uses Jekyll, which conveniently stores information such as the address of each post. This can be obtained by calling page.url. As these links need to come from externally, you’ll need the rest of your website’s address included as well, obtainable via absolute_url:
{{ page.url | absolute_url }}
From there, it’s a matter of working out the format of the links for the respective social media sites you’d like to use.
http://www.facebook.com/sharer.php?u={{ page.url | absolute_url }}&t={{ page.title }}
http://twitter.com/share?text={{ page.title }}&url={{ page.url | absolute_url }}&hashtags={{ page.category }}
Google+
https://plus.google.com/share?url={{ page.url | absolute_url }}