Over the last 20-odd years I’ve created a handfull of blogs, hosted on a variety of platforms, and with a variety of topics. The cadence of my posting has always varied, but it’s been pretty slow over the last few years in particular. Mainly, this is just that I’ve been “burned out” and rarely find the motivation to post anything. With a new adventure in the pipeline, I’ve been thinking about whether and how I want to blog about it. The existing pattern would have me just start a new blog, on whatever platform seems best at the time, but I’m ready for a change.

Issues and Considerations

Filtering

A key issue I’ve used as a(n internal) excuse to not post relates to filtering content to suit different audiences. Lately, I’ve mainly blogged about the techie stuff that has occupied most of my time, but I’ve also been hunting feral goats and turning them in to tasty food. It wouldn’t be great if I dropped a photo of a half disassembled goat, in a feed that someone had subscribed to after reading a post on Rust firmware, but in the existing paradigm the choice is between doing that and starting a blog just for the goating. It would be really nice to have the ability to share a link to the conservationist hunting stuff (which wouldn’t link out to the techie stuff), another link to the techie stuff (which souldn’t link out to the hunting stuff), and a firehose link that has everything I post (to share with friends/family).

Tech Stack Familiarity

It’s also a bit of a pain to occasionally dip in to Wordpress or Jekyll or whatever else, to make the inevitable fixes as time marches on. This usually involves a few searches and fiddling with tools and technologies that otherwise I wouldn’t need to use - it feels like a waste of time, since other than (rarely) blogging I really don’t do much with webby technology. As I write this, I’m concurrently struggling to get Jekyll to run locally (narrator voice: because he only touches Ruby package management every couple years, and can’t remember bundle install, bundle exec jekyll serve). I’m sure if I logged in to the Wordpress admin interface for any of my older WP blogs, they’d need updating too. Does Blogger even exist anymore? Dealing with just one tech stack would be really nice, so I’m looking to consolidate.

Hosting Tradeoffs

While it’s been nice to use platforms like blogger or wordpress.com that provide hosting, there are some tradeoffs involved; how are costs are covered, long-term reliability, and maintenance effort vs flexibility. Graphic here. For the moment, I’m pursuing a static site generator, hosted on a VPS. If costs become prohibitive, some funding options might be to set up affiliate marketing links, or provide a method for readers to donate.

Migrating Old Blogs

Since I’ve got a few existing blogs that seem worth keeping around, I’ll need to bring them in to the new scheme, whatever that turns out to be. Hopefully, the solution I go with is mainstream enough that someone else has already made a migration tool. But, I suspect that the content I’ve made is to such a bland standard that my own migration tools wouldn’t be hard to make anyway.

github.io and Git for drafts

My most recently active blog is hosted by GitHub Pages, and the source repo is public. Since I don’t want to post my roughest drafts at all, I’ve been somewhat naughty and only pushed posts that I’m ready to publish to GitHub. GitHub Pages uses Jekyll, and Jekyll does have support for managing drafts, so I just need to switch any drafts that are worth keeping (are there any?) over to that approach.

Video Hosting

It would be great to add the occasional video on here, now that such things are so easy to create. Given the low amount of traffic that I expect to draw, I can probably just host videos more-or-less as if they were images, but more research is definitely required…

Posting Considerations

Most of my existing blogs relate to remote locations (where Internet access is limited) or travel (where gear needs to be minimised). For these, I’ve almost exclusively used web interfaces to manage posts, with the main exception being more recent Wordpress blogs where I’ve used an iPhone app. In my earlier blogs, I’d access these web interfaces through public computers (Internet cafés, libraries, hostels, etc) when away from my own. Public computers are much less common now, it’s safe to assume I’ll always have access to a smartphone, but probably not a laptop. So, I’d like to have an idea of how to manage posts from a smartphone, even if that’s not implemented for the upcoming trip that prompted this blog rework.

Assuming a static blog, there’s also a question of where rendering happens. It could be done on my laptop with static content uploaded to the server, or I could upload source material and have the rendering happen on the server. From a maintenance standpoint, I quite like the idea of rendering locally, but that inherently requires more bandwidth for updates. Considering that I’d like to post videos, and those will probaby need to be transcoded during rendering, I’ll aim for rendering on the server.

Aesthetics

Although I’m not overly concerned with the look and feel of my blog, I do want it to be reasonably legible on smartphones and real computers, and at different magnifications. It probably wouldn’t hurt for me to learn some modern HTML+CSS, but at the same time, I’m not using this as some kind of showcase for my web dev skills!

Sharing an early iteration of the new blog with a local tech chat has helped quite a lot in this deparment! The current layout is pretty janky, in particular I’d like to make the text columns a bit narrower (when on large screens - phone seems fine), centre the whole thing on the screen, add dark mode support, maybe pick a better font.

Recently I noticed this blog has a look I like, it seems to be rendered using Zola which might also be more my speed than Jekyll.

Solution

Sticking with Jekyll, as is used on my current blog, seems like an easy path forward. A static site should serve my needs just fine, and it’s the only static site generator (SSG) that I’ve used for an appreciable amount of content. Once all the other content is migrated in to Jekyll’s format, it should be easy enough to convert it to whatever other format is required if I decide to change SSGs.

Filtering

Filtering is accomplished using Jekyll’s collections feature, but the approach is a bit non-obvious. When Jekyll builds a static site, it renders an HTML file for each post/page - including stuff like the navigation bar which links to other posts in the blog. I’d like for the filtered views in to my blog to be self-contained, without links that lead to any filtered-out posts. That navigation bar link needs to change depending on which filter the reader is viewing through - if I’m viewing “Rust Firmware Debugging” through the tech filtered view, then the link in the sidebar should only show tech posts, but if I’m viewing “Rust Firmware Debugging” through the unfiltered view, it should show all posts including “Goat Processing 101”.

The above seems to imply that I need Jekyll to render multiple versions of each post, and thankfully that’s easy to do. During the build step, Jekyll will follow filesystem links, so a post can be written once, then linked to any number of times, to create any number of posts rendered to HTML with the same source but potentially rendered differently. Content can be assigned to a collection in at least two ways: front matter (essentially: code in the content source), or based on the filesystem path to the content source.

First, _config.yml needs to know about the collections:

collections:
    tech:
        output: true

Add some content to the collection using a filesystem link:

.
├── _posts
│   └── 2024-07-28-blog-condensation.markdown
└── _tech
    └── 2024-07-28-blog-condensation.markdown -> ../_posts/2024-07-28-blog-condensation.markdown

2 directories, 2 files

There might be an easier way to accomplish this, but I’ve currently got a couple source files to generate the lists of posts - index.html shows all posts, tech_index.html shows all the tech posts. The original index.html looked like this:

---
layout: default
---
...stuff...
{% for post in site.posts %}
    ...output post links, previews, etc...
{% endfor %}

We need to tell Jekyll which collection the index is associated with, so it can render the appropriate sidebar (more below) - change the index.html front matter:

---
layout: default
collection: posts
---

And the filtered views now have something like this. The permalink front matter causes the tech index to show up for visitors to https://ianrees.nz/blog/tech .

---
layout: default
permalink: /tech/
collection: tech
---
...stuff...
{% assign posts = site.tech | sort: "date" | reverse %}
{% for post in posts %}
    ...output post links, previews, etc...
{% endfor %}

Now, in sidebar.html, we can add a link to posts for the appropriate filtered view:

{% if page.collection == "posts" %}
<li><a href="{{ "/" | prepend: site.baseurl }}">Posts</a></li>
{% elsif page.collection == "tech" %}
<li><a href="{{ "/tech/" | prepend: site.baseurl }}">Posts</a></li>
{% endif %}

Outstanding Issues

Some things I’ve not yet sorted out

  • Style and formatting - this blog is ugly!
    • favicon.ico
    • Better syntax highlighting (and set background in code blocks)
    • Convert existing photos to new style markup
  • Import wordpress blogs
  • responsive image issues
    • (Force-)pushing changes to images doesn’t result in them being resized
    • Images shouldn’t be scaled up
    • Formatting broken with animated gif in voltage glitch injection post