Twitter Share Button

Add Twitter share button to your Jekyll template.

Set Twitter username in Jekyll config file _config.yml:

author.twitter: ivanchromjak

Create _includes/share.html file:

<div class="share">
  Share this on &rarr;
  <a class="twitter" href="{{ page.title }}&url={{ site.url }}{{ page.url }}&via={{ }}&related={{ }}" rel="nofollow" target="_blank" title="Share on Twitter"><span class="icon icon--twitter">{% include icon-twitter.svg %}</span> Twitter</a>

Include the share.html in post layout file _layouts/post.html:

{% include share.html %}