Use Jekyll and Bootstrap to create a tag-area with links to pages showing only the articles of the current tag

For my personal blog, which in based on Jekyll, I created a tag-area on the top of the homepage so that the visitors are able to navigate through the different articles in a tag-page by clicking on the tag that they are interested in. With this article I would like to present you the code of the tag-area:

1
2
3
4
5
6
7
<div class="well well-sm">Filter the articles:
    {% for tag in site.tags %}
        <a class="btn btn-warning" type="button" href="tags/{{ site.baseurl }}{{tag | first }}">
            {{ tag | first }} <span class="badge">{{ tag | last | size }}</span>
        </a>
    {% endfor %}
</div>

The final result looks like that:

Tag-area with Bootstrap styling

comments powered by Disqus