Reality, Meet Opportunity

For quite a while now, I have wanted to update my blog, do some more writing (both personally and professionally) and generally flex some unused muscles a bit. Fortuna often has sadistic tendencies as some can attest. Consider the recent toppling of the NS8 empire 1, 2, 3, 4, 5, 6 and a great fall of nepotism with recent developments and former employee actions. So many links to criminal conspiracy to defraud and so little daylight; regardless, I have had more than a little time to navel gaze in recent weeks.

I’ve long been frustrated by the available tools for blogging. Some of these goals compete with each other and some are onerous due to costs–I want as much of my platform to be free (both as in beer and as in speech) as possible and I want as much control over my platform as possible and I want to have features like commenting and search and analytics and there can be no ads and the word Jekyll may not be invoked. I have an old Blogger site, which I desperately want to retire; and I have a Medium site which I am increasingly frustrated with: from the inability to post articles in the past to Mediums idiotic approach to monetization–what was initially cool about medium is no longer interesting to me.

So I set out to figure out how to create the blog platform you, dear reader, are currently (hopefully) enjoying.

Goals

Broadly speaking, I want to be able to meet these objectives:

  • Easy to add new posts
  • Easy to update existing posts
  • Keep revision history of edits
  • Blog is searchable
  • Commenting in some form is possible, and comments are stored in my control
  • No ads (at least for now)
  • Service is free for me to host my content and free for consumers
  • I can more or less change anything about the blog at whim
  • Fast to manage

Non-starters

I considered a number of options, and I won’t go too deep into the pros and cons so much as leave breadcrumbs for others to follow (in no particular order):

  1. Medium: it looks nice, but I have to surrender too much control. It’s not free as in speech or free as in lattes.
  2. Blogger: it looks dated. It does most of what I need, but it’s slow to manage and cumbersome to maintain.
  3. Ghost: it used to be a nice competitor to Medium, but the target audience for users no longer includes me. It’s free to self-host, but non-trivial to manage.
  4. All other self-hosted solutions (Ghost included): while I can run anything on my local systems, I don’t want to depend on my personal equipment to run my site and I don’t want to have to deal with security (although services like Ngrok and Pagekite are awesome and definitely worth your time).
  5. Cloud hosting options are a mixed bag when looking for free. You can get lots of usage out of Azure on the initial free options, but eventually you have to pay.
  6. WordPress/Drupal/etc. Will never use; will not investigate.

Solution

One “blog” concept that I’ve always liked is by @raganwald is his use of Github for organizing content. I have long considered this approach as it checks off a lot of boxes:

  • Complete control
  • Free as in latkes and free as in peaceful protests
  • It’s git, so it’s all under control

The perceived negatives I have had in the past seem to be less of an issue these days with the emergence of a few factors (some relatively new, some a bit older):

  • Github Pages: a free static content website based on the content of a branch of your repository. Commonly the gh-pages branch, which is how this blog is served.
  • Github Actions: Manage your updates to Github Pages automatically
  • Github Codespaces: Everything you need to manage your site, in your browser. This is a very nice to have–you can do this anywhere/anytime already with other tools.
  • GatsbyJs: A pretty slick static site generator based on React. Lots of extensions and pluggability.
  • Comments: Using a tool called Utterances, which is just a convenient wrapper around Github Issues–commenting is free and easy and completely under my control.
  • Search: This is the only 3rd party piece that I cannot take and move just anywhere, but it’s free as in pancakes for my purposes, so I’ll content with it for now and/or until I need something better.

Getting There

I did some basic soul googling for blog github pages -jekyll and quickly found Creating my blog with Gatsby and Github Pages, which was more than enough to get me going. I explored a variety of Gatsby Templates (once I had decided that Gatsby would meet all my needs) and I picked the Gitbook Starter template as a base. There were a variety of things I needed to change–most notably the logic for generating the sidebar tree, which required comparing the template repo with the demo repo.

Most of my time was occupied fixing annoyances–I spent more than a few hours wrestling with the gh-pages module that I use for automating deploys to, you guessed it, Github Pages. The production build process for Gatsby is much slower than I would like, which is especially annoying in the early phases of development when you’re making lots of minor tweaks and changes. Combine that with trying to guarantee that I cache bust my site with new deploys, the general speed of build+deploy, local caching issues, remote caching issues–and I easily spent most of a day refreshing my browser in a state of uncertainty as to whether I was testing the right version of my code. Once I generally worked through my self-inflicted CI/CD pipeline issues, I am very satisfied with what I was able to throw together over a day and a half.

Outstanding Concerns

One of the fun bits of doing all this work is that it’s a beautiful combination of development work, writing and designing–all of which I love. I get to keep polishing my dev chops as I work through my backlog of blog posts to migrate as well as explore new technologies and solutions to my own little set of concerns. I’ve historically struggled to find a development problem that aligns with my personal interests, and for the first time I feel like I have the beginnings of a solution here.

Still, much remains todo if I want to consider this feature complete:

  • Add analytics so I can measure traffic.
  • Some form of management for comments.
  • Find alternate ways to authenticate for comments so not everyone needs to have a Github account to comment.
  • Fix some rendering issues on page load.
  • Tagging and other basic “bloggy” features.
  • Migrate all my old content over.
  • Refactor the whole thing to TypeScript, because {reasons}.
  • Refactor the whole thing from TypeScript to Rust, because…why not?

If any of this has been interesting, please let me know in the comments or in the code, which is the blog, which is the code, which…!