Alex Kreidler

ProjectsBooksBlog

The Perils of CMSes

Apr 14, 2020

Note: This article is about the two prior versions of this blog.

A while back I started my first blog, with a focus on Docker, Golang, and DevOps.

I wrote a few articles on my setups for Protobuf-based development in Go. I also wrote a benchmark of Golang filesystem IO using its famed parallelism constructs. The source code to that repo is available here: https://github.com/alexkreidler/golang-parallel-io

However, I can’t find the actual article itself, or any of the other articles for that matter, because I used a CMS but didn’t properly save or export my data before deleting the VM that it was hosted on.

The CMS was Ghost a very nice and popular platform. However, it had drawbacks:

  • All the data was stored in a mini SQL database, and some in configuration files colocated with the themes/templates
  • It had to run a fairly memory-heavy server process just to serve the site

Markdown for the win

So, gradually and somewhat grudgingly, after holding suspicions against the first generation of static site generators (SSGs) like Flask, I’ve come to accept that they are the best option for any sort of writing 1 or blogging.

Let’s start here. The benefits are:

  • Static: you can deploy to S3, Netlify, GH Pages, virtually anywhere. Most of these places are free b/c you’re not paying for any real server-side processing, just the costs of storage and transfer
  • Markdown: you’ll never accidentally lose an article again if they’re all in plain text. This offers an easy way to move them around: just copy the directory.

And another final reccommendation from my lesson learned with writing: store it all in Git. You already use it for code, and writing is just as precious, if not more, than your code itself.

For me, Eleventy (a.k.a 11ty) has been simply delightful. It starts very simple, just transforming the HTML, Markdown, or other source content you have. From there it allows you to define templates in a variety of languages (Nunchunk, Handlebars/Mustache, Liquid, etc). It also has a rich but understandable system for metadata and data in general. In fact, it allows generating pages based solely on data.

For this version of the blog, I decided to use the Hylia Eleventy theme.

Full circle

A few hours ago, I was perfectly fine with my newfound minimalistic approach to blogging and writing.

Then, while looking for Eleventy themes for this blog[^theme], I learned about Netlify CMS2, which follows all of the principles above: Markdown, Git, should be editable on-disk like any other project. But it wraps all of that up in a nice admin UI, which allows for easing creation, editing, and previewing of articles.

It has a few complexities, like how users are authenticated and how they interact with your Git repository (especially for non-Github hosts). For the most part though, it promulgates the Git Flow mentality even further all the way to content management. It seems like it could offer a lot of value for teams, but for myself, to be honest, I feel it may be something that I like in theory but rarely use.

However, I always imagine it could be useful when I’m not able to clone a repository but just want to use a Web UI.

So, we’re back to a CMS. Really?

Well we know now that it really is much different. In fact, day to day, as I mentioned above, I barely use the CMS. It’s just there as a nice backup.

But the answer is yes: I have a blog that works well for me, looks great, loads fast, and has tooling better than anyone could have imagined back in the Jekyll days.

And I might even be able to use React components in my Markdown if I set that up! Here comes the future.

Footnotes

  1. I actually recently discovered the joy of Pandoc, a powerful Haskell-based CLI tool for converting between many document formats. It is used heavily by academics and writers of books. It has also popularized a style of Markdown known as Pandoc markdown that has support for many exciting things, like these footnotes. However, now that I’ve realized 11ty supports it (through the markdown-it JS library), I can write in the same format, but no longer need an external preprocessing step for my static websites. However, Pandoc still is useful for generating PDFs and EPUBs.

  2. I had been using Netlify as a hosting service for a while, so I always assumed Netlify CMS was a paid product/feature for Netlify customers. Much to my surprise when I discover it is a completely open source solution and can be used without Netlify, although it does integrate very well with Netlify. I might have picked it up sooner if it had a different name, but otherwise, it is a well-executed project.