---
layout: post
title:  "Adding privacy-conscious share buttons to Jekyll"
slug: jekyll-stealthy-share
date:   2018-01-10 06:00:00 +0000
categories: jekyll setup
---

Recently, I've been getting familiar with [Jekyll](https://jekyllrb.com/), the static site/blog generator.

Firstly, Jekyll is a really great free software project! I've deployed websites generated by Jekyll before, but I haven't spent much time diving beneath the service and getting to know the library itself. Now I've spent some time with it I really like the way it works internally &mdash; the interface feels very clean, and the plugin API it exposes which opens up a lot of possibilities for creativity when building blogs.

To help familiarize myself with it, I've written a Jekyll plugin for the first time. It's called [jekyll-stealthy-share](https://github.com/rfwatson/jekyll-stealthy-share), and it adds Liquid tags to Jekyll that will inject simple, HTML-only share buttons into any static page.

The share buttons are HTML-only. This is because I have no wish to inject JavaScript code from Facebook, Twitter et al into my blog, nor pass the privacy implications of doing that onto my visitors. Additionally, rendering the buttons myself ensures that I have full control over their appearance.

Here's the share buttons in action:

{% stealthy_share_buttons %}

The plugin does two things:

{% raw %}
* Adds `{% stealthy_share_buttons %}` and `{% stealthy_share_assets %}` [Liquid tags](https://jekyllrb.com/docs/plugins/#tags), that can be injected into posts at will
* Adds a `/assets/share.css` static file, using a Jekyll [generator](https://jekyllrb.com/docs/plugins/#generators)
{% endraw %}

The share buttons can also be customized and re-ordered, and new sharing templates added in your own site's content.

See [jekyll-stealthy-share on GitHub](https://github.com/rfwatson/jekyll-stealthy-share) for more details.
