Member-only story
Jekyll — How To Display A Count Of Posts Per Tag Or Category
My Changelog website is where I keep track of all my creative work online. It contains links to every article, newsletter edition, digital product, and project I create.
I built it in Jekyll, my static site generator of choice.
One of the first hurdles I had to navigate when building the site was how to display a stats page. This would summarize all my content under a few different parameters. I wanted to display counts of posts per categories as well as tags.
Here’s how I accomplished setting up a display of post counts per category and tag.
Site Structure
Let’s start with a summary of how things are set up on the Changelog site.
I have the following tags:
- Coding
- Creation
- Design
- Milestone
- Productivity
These serve as the main buckets or topics I talk about most often. My niche if you will.
Milestone is slightly different. It denotes various markers I want to celebrate like hitting 500 Twitter followers or growing my Medium following.
Then I have categories:
- Article