Configuring Jekyll Tags

Details on how to overcome the lack of an obvious Jekyll feature.

Configuring Jekyll Tags
Photo by Jason Leung / Unsplash

Now that I'm beginning to accumulate posts, I've setup post tags. This includes both HTML pages & Atom feeds per individual tag.

Doing so wasn't easy, as the official Jekyll documentation tells you tags are supported but doesn't indicate how to build out the above pages. Luckily, I found the jekyll-tagging plugin, which works nicely. I followed its instructions, only to then realize it wasn't one of the gems officially supportedby my host Github Pages. So back to the drawing board for that portion.

I also had to modify some Minima templates, so they would include tags on the page display itself. This required some extra fumbling to setup new layouts within my _layouts directory, then add the following to my post.html template (thanks to this helpful snippet from Stack Overflow):

{% for post in site.posts %}
    {% if post.tags != empty %}
        {% for tag in post.tags %}
            <a href="{{site.baseurl}}/{{site.tag_page_dir}}/{{tag|slugify}}">{{ tag }}</a>
        {% endfor %}
    {% endif %}
{% endfor %}

As mentioned above, the tag-specific pages don't yet exist, so clicking on a tag will take you to 404 land. Now I remember why I was paying for a blog host instead of DIY.

Onward and upward!