After I migrated my blog to Jekyll I started to look for a tagging engine to support tag clouds. Strangly enough Jekyll ‘supports’ tags in the markdown header, but they are not used (as far as I can see, that is). So I ended up using jekyll-tagging
available at https://github.com/pattex/jekyll-tagging.
Here’s the steps I took to make it all work. The first steps are exactly as described in the jekyll-tagging
installation instructions.
Install jekyll-tagging
:
sudo gem install jekyll-tagging
Add the following to _plugins/ext.rb
require 'jekyll/tagging'
Add tagging options to _config.yml
:
tag_page_layout: tag_page
tag_page_dir: tag
I then created a tag page layout. Save this under _layout/tag_page.html
:
{% highlight html %}
layout: default —
{{ page.tag }}
-
{% for post in page.posts %}
- {{ post.title }} ({{ post.date | date_to_string }} | Tags: {{ post | tags }}) {% endfor %}
Tag cloud
{% endhighlight %}
You will now have to tag your posts, unless you haven’t already. So in each post, add the tags
to the header. This will tag the post under jekyll
and tagging
.
---
title: My post
categories:
- jekyll
- tagging
---