Development

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="https://twitter.com/intent/tweet?text={{ page.title }}&url={{ site.url }}{{ page.url }}&via={{ site.author.twitter }}&related={{ site.author.twitter }}" rel="nofollow" target="_blank" title="Share on Twitter"><span class="icon icon--twitter">{% include icon-twitter.svg %}</span> Twitter</a>
</div>

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

{% include share.html %}

Related Posts

Hugo

The Ultimate Guide to Choosing and Customizing Hugo Themes

Unleashing the power of Hugo static generator for your website.

Hugo

Unlock the Potential of Your Hugo Blog

Delve deeper into the world of Hugo blog themes and how to get started fast.