What I’d Need To Know In Order To Move The Blog To Kirby

Briefly this past October, because of Kev, I spent some time looking into Kirby as a potential replacement for WordPress, because at this point that CMS is bloated and my solutions to things often pretty janky. It didn’t take long browsing the Kirby documentation for a legit anxiety response to kick in. The kind that feels something akin to claustrophobia.

This is frustrating to me in part because I’m not entirely incapable, although I regularly have to re-learn things that I’ve done in the past. Back in the early days of blogging, I routinely made custom Blogger templates for myself. For years I self-hosted first Moveable Type and then WordPress blogs on a custom-built OpenBSD box that served sites over my home DSL connection. This blog currently is self-hosted from a droplet.

Nonetheless, every time—every single time—that I try to delve into Kirby, I seize up cognitively. In part, although I do not think in whole, it’s because the entire thing is customizable, and in fact requires it. You need to build “blueprints” for the CMS itself, not just templates for the public-facing site. It’s all done through configuration files; there’s no such thing as, say, a blueprint builder or generator.

This blog contains a bunch of the aforementioned jankiness to get various things to do what I need them to do, and much of those solutions come from weeks of frustrating conversations with ChatGPT to come up with custom functions for several things that WordPress itself has never found important enough to solve natively, and many of which apparently aren’t popular enough use cases for the plugin ecosystem to solve either.

Last night and this afternoon, I did sit down once again to try to make some headway, but once I left behind simply working on basic templates and started looking at functionality, I hit that wall all over again.

As I said in October, I couldn’t actually afford the $85 license of Kirby anyway. Nonetheless, I thought it might make sense to write up a list of all the things I’d need a Kirby-based blog to do. All the things I do here, whether they are no-brainers under WordPress or things I’ve had to fight with ChatGPT to solve.

For these purposes, assume that I’d have a directory structure that follows my current permalinks scheme. This post, for example, under Kirby would be located inside a 2023 directory, then inside a Dec directory, then inside an 05 directory. This, of course, also presumes that Kirby has a way of saving files correctly to such a structure, with a blog post being saved to its relevant day directory based upon the post date when publishing.

The front page

As I currently understand things, what makes the most sense here is that my front page would use the home.php template that’s in the home directory.

My front page consists of:

  1. The title and content of the most recent post. Presumably there is some way to do this in Kirby, but it’s not clear to me how it works when your content is organized by the above date-based directory structure rather than simply all your posts in one directory.

  2. Site navigation (which here is in sentence form). This is not complicated at all, and I’d probably maintain it using a snippet for ease of getting to it if I need to make any changes.

  3. The next fifteen most recent posts, with a link to the Posts page for more. See item (2) regarding how this works when you’re using my date-based directory structure, and here I also use a “days ago” format for the <time> element and had to get ChatGPT to do that for me.

  4. Any posts published on the current day in previous years. To get this to work under WordPress, I had to turn to ChatGPT to make me this code. I’m not sure how you’d do this under Kirby, but I somewhat imagine someone must have done it before, although (again) I’m not sure how my directory structure impacts this, if at all.

  5. A list of recently read blog posts, link to my Bloglog folder on Instapaper, and a sentence linking to my Linklog folder on Instapaper. Again, for WordPress this came as a solution given to me by ChatGPT, although I believe it simply uses SimplePIE which presumably would be usable under Kirby, as well, although maybe there’s a plugin for this.

  6. A list of places to find more blogs. This is simple HTML and again I’d likely maintain it in a separate snippet so I don’t have to go rummaging through the home.php template.

The posts page

This presumably would function out of a posts directory using a posts.php template.

My posts and archive page consists of:

  1. The page description. This in part under WordPress is dynamically generated using custom code, again from ChatGPT, to get the total number of posts, the total word count, the total number of sources (categories), and the total number of years represented; the rest is written by hand.

  2. The search box. I’m simply going to assume that Kirby naturally has some sort of easily-implementable search function.

  3. The sources list. Here I used ChatGPT again, but this is a simply list of sources (categories) and the number of posts in each, and is the sort of thing I assume I could either figure out from the documentation or would find an easy answer on the forums.

  4. The years list. This came together in much the same way as the above list of sources (categories), and I assume must not be overly complicated although I haven’t looked into it at all.

  5. The posts list. A simple paginated loop through all posts, reverse chronologically, at one hundred posts per page, with different <time> format than the front page, and I started to look at this when I was tinkering earlier today and got confused, I think in part because of my directory structure but I don’t remember.

The source pages

I’ve done no looking whatsoever to see how Kirby handles category pages, but I assume there must be some form of templating involved.

My source (category) archive pages consist of:

  1. The page description. Much like on the Posts page, under WordPress this comes through a combination of the written text of the category description and ChatGPT both gave me shortcodes for the post and word counts limited to the current category and a function to allow shortcodes in the category description.

  2. The posts list. A simple paginated loop through all posts in the current category, reverse chronologically, at one hundred posts per page, with different <time> format than the front page.

The date pages

Here I should note that ChatGPT this afternoon did give me one Kirby approach to this, although it clearly was incomplete for the totality of my purposes. It suggested that I essentially use my default.php template to run the date archive pages, allowing me not to have to have templates defined for every single year, month, and day directory. I’m not entirely sure if using that approach all the other things I need to do are possible.

My date archive pages consist of:

  1. The page description. This again uses custom functions from ChatGPT to call the post and word counts for the year or month or day in question, but also then uses custom functions from ChatGPT to list the categories used during the relevant year, month, or day.

  2. The posts list. A simple paginated loop through all posts in the current category, reverse chronologically, at one hundred posts per page, with different <time> format than the front page.

It’s important here to note that as constructed in WordPress, only my year archives work, because the date archive code doesn’t recognize the custom %monthname% tag in my permalinks setup, a custom tag that came, again, from ChatGPT.

Also, I’m entirely unclear on how one would get Kirby to output in the page description, for example, “December 2023” instead of “Dec” on a year archive, or “December” instead of “Dec” on a month archive, or “December 5, 2023” on a day archive. Understand that I am trying to avoid having to build, manually, .php and/or .yml files for every single year, month, and day directory.

The posts

My posts consist of:

  1. The post title. There’s nothing mysterious here, and in most ways as far as Kirby is concerned, making the article.php template probably is the easiest, most straightforward thing.

  2. The disclaimer. On posts older than ten years (or maybe it’s ten years and older), a disclaimer appears. Here, again, I presume this is doable in Kirby although I’ve no idea of the specific process.

  3. The post text. See above (1).

  4. The post meta. I have my post metadata in sentence form, and here again I can’t imagine there’s anything especially taxing to figure out.

Summary

So, there you have it. That’s my “spec” for moving the blog to Kirby. Ignore the issue of actually moving the content from WordPress.

I’ve been doing a major project restoring twenty years of blog posts and doing most of this by hand anyway, so I’m not even concerned about how the posts would get moved, and I’m sure if that time came I could jury-rig something to export my posts out all set up in my Kirby directory structure.

If somehow you’ve bothered to make it this far, I more than welcome any feedback or tips on any or all of these items. I don’t expect one person to solve them all for me, but if enough Kirby folks over time stumble onto this post, maybe I can build a library of solutions over time.


Addenda

  1. To show you how exhausting this post was, I forgot entirely two critical components: untitled posts and internal backlinks. These are non-negotiable features.

    Rather than build out this post further, you can see existing discussions on the Kirby forums: one about untitled posts (scroll down for how I handle this in WordPress), and one about internal backlinks, where one solution might be just to use webmention.


Referring posts