It’s been a while since I wrote anything so its high time to correct this. One of the holdups has been that I wanted to write this blog webpage in separate categories and it turns out that Jekyll can do this … but like most adjustments, it is not simple. Jekyll is very good at doing the basics, the way it was set up but to make adjustments, it is not simple at all. This “liquid” language that is uses is a real nightmare.
Anyway I managed to get different blog post categories displayed by:
In the root Jekyll directory, create new subdirectories for each of the categories that you want to sort posts by. My new ones are called “Music”, “Travel”, and “Computing”.
In each of these new subdirectories, create a new “_posts" directory, which Jekyll will now find automatically.
Also in each subdirectory create a new .md file that corresponds to that category, i.e for my Music subdirectory, my Music.md file contains
---
layout: page
---
Music
======
- Then I created a .html file for each of these categories, that contain the code to filter out and display only the blog posts relating to that subject. Again for the music category, this is what the music.html file looks like
---
layout: page
title: Music
header: Music I like!
group: navigation
---
- Finally I put additions into my navbar.html file, to create a menu item in the navbar, and also to point to the above mentioned .html file to get the posts for that category only. Most of the information was gleaned, … very slowly from this github post. Hope it helps you too.
It might not be elegant, and if anyone has suggestions to make it simpler or work better … I’m all ears.
Hope this helps.
J