Porting My Site to a Static Site Generator
If you have visited my blog in the past, you probably noticed that I have updated my site to a new look and feel and removed some features that were previously available- like page counts and comments. What you may or may not have noticed is that in addition to updating the site skin, I ported the back end of the site off of the CFML-based ContentBox to an HTML-only site produced using a static site generator.
I’ve been considering the move to HTML-only on and off for a little while, and I finally decided to make it happen. The good news? I was able to port the entire site in a day. The bad news? I’m not exactly thrilled with the limitations imposed by static site generators, and the actual process of writing and deploying content is more trouble than using a CMS. More on that in another post.
Why I Moved off of ContentBox
Although it is a great CMS, I would not be surprised if you are unfamiliar with ContentBox. The brainchild of Ortus Solutions, a top CFML consultancy and the creators of ColdBox and CommandBox among other great open source products, ContentBox has a lot of features but remains a niche product. In my opinion, that’s largely due to the slow fading of CFML engines into niche status. Adobe’e ColdFusion is the most well known - and the original - CFML engine, but Lucee is an open source competitor and is a great platform in its own right.
The truth, though, is that the rise of a good open source CFML engine came too late. PHP took over the low-end scripting engine space years ago, and the rise of NodeJS has squeezed out other competitors. Lucee is still a great platform, as is ColdFusion, but market relevance requires mindshare among developers and executives, and CFML’s mindshare is limited.
Whilte that doesn’t really matter to me for my personal blog, it doesn’t provide a compelling reason to stay on the platform, either, and since I was considering moving to a static site generator anyway … well, you see where this is going. I’ve had six different iterations of a personal/technical blog starting in 1995, and they all used different systems. The very first one was a static HTML site, so this move in a way is a return to the roots of the Web, though with a modern twist.
Static Site Generators
What to say about this category of products? You can read entire tomes about some of them, so I’ll just cover the basics. In one way or another, static site generators (SSG) take a combination of styling/layout, templates, and content and generate (hence the name) a complete static HTML site. SSG offer many different features depending on the specific product you choose, among them support for HTML or Markdown (ugh) content formatting and support for content metadata in a variety of formats. The key is that you build content offline, use the SSG to build the finished site, and push the site live when you are ready to deploy.
Yes, I literally groaned out loud when I wrote Markdown. I get it, all the kids love it for it’s ease of use and simplicity. Supposedly. I’m sorry, I don’t really see it. Markdown is great for writing simple content like this post, but complex content formatting that renders in HTML is a huge pain and not standarized across all implementations.
Maybe I’m biased because I can write HTML in my sleep, but I find Markdown to be limited in its appeal. More importantly, when creating content in a CMS you don’t actually write HTML, you use a WYSIWG editor that acts like a word processor and hides the HTML from you. Markdown feels like a return to Wordperfect circa 1988. I’m sitting here writing this post in Markdown in my Atom IDE with a real-time HTML preview pane next to the editing pane and I’m wondering why Atom is forcing me to write Markdown at all instead of handling the formatting for me. And yet here I am using it, because technology sucks and we just have to deal with it.
After a review of some of the options available in the open source SSG space, I settled on Hugo as my platform of choice. Why?
- written in Go, very fast
- good feature set
- open source
- large theme library, also open source
That’s a good enough list for me, so here we are.
In case you haven’t caught on yet, Hugo is a command line tool. Generating a site from Hugo means issuing a command:
There are lots of commands you can pass to Hugo, I’ll leave it to you to review the docs if you are interested. Look for another post soon that goes into some details.