Permalinks

I discovered that my permalink format in _config.yml had a hardcoded element left over from the original build of the site. Every post, no matter the type, had the prefix /blog in its url. This was because I had the global permalink set as:

/blog/:year/:month/:day/:title

The Jekyll documentation had an easy fix. I simply had to replace /blog with /:categories, like so:

/:categories/:year/:month/:day/:title

However, this produced some peculiar results. I currently have four directories with posts on the site: /blog, /portal/commonplace, /portal/journal, and /about/log.

The first three worked as expected, displaying as with the examples below:

/blog/2022/06/19/compost-epistemology

/portal/commonplace/2022/11/10-william-gibson-the-jackpot
/portal/journal/2022/11/03/the-peripheral

But for some reason, my site log had an extra term added to the url:

/about/log/update/2022/11/11/post-navigation

My blogs use the layout type “post,” my commonplace book uses the layout type “entry,” and my journal uses the layout type “journal.” Similarly, my logs use the layout type “update,” but for whatever reason only these posts interpolated the layout type between the category and the date. I ultimately decided to remove category entirely, and settled on a simple date prefix instead:

/:year/:month/:day/:title

Though calling out the category in the url would be nice, this format makes for a much more compact link, and won’t break in the future if I decide to move a collection of posts to a new category, or change the category name. The permalink will remain the permalink, separate from site navigation within a given category.

A weird thing though… While fussing around with all of this, I somehow caused the post navigation to flip again, as I struggled to resolve in 2022-11-11 log. For whatever reason, the point that had nagged at me in that log was now precisely the thing requiring a fix. I opened the .rb file and flipped back the next_in_category and previous_in_category variables, while leaving the navigation div with next on the left and previous on the right (and so under their opposite headings). I could probably now do the opposite, re-flip the variables in the .rb and then put next and previous on the correct side in the navigation div, but I’m going to save that attempt for another day. With this fix, everything appears to be working properly again.


Previous Update Next Update

« Post Navigation Markdown Journal »