old-techblog/_posts/2018-01-10-jekyll-stealthy-...

1.9 KiB

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

Recently, I've been getting familiar with Jekyll, 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 — 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, 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, that can be injected into posts at will
  • Adds a /assets/share.css static file, using a Jekyll generator {% 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 for more details.