Creating the akafred blog site

Photo by Stokpic / CC0 License | Modified from original.

Using a static site generation tool for your blog makes your blog performant and secure. Using Docker helps you get started quickly.

Aller anfang ist schwer my German teacher told us, and oh my! does that apply to blogging when you are a techie, who—in theory at least—could have built a blogging platform if you just had the time. It does not help that you have extremely capable colleagues who probably have done just that. Obviously the abandoned WordPress-blog from yesteryear does not cut it anymore …

As static site generators are all the rage now, I decided to try the most popular one, Jekyll. Jekyll was originally created 6 years ago by the now ousted Github founder, Tom Preston-Werner, but seems to be in active development still. There are other popular static site generators, but I chose to just go with the flow, trying not to create extra pre-blogging hurdles for myself.

Static site generators have a some very nice characteristics:

  • Page generation happens generation-time, not when serving the page, which means a faster site and lower server load.
  • Less code and fewer components on the server reduces the attack vector, your site can be made more secure.
  • No relational database with state, and in fact, after the site is generated it is immutable - which makes it easier to reason about.
  • Usually your site is generated from plain old text files (and perhaps the odd image), which is very amenable to revision control systems.

While static site generators demand very little from your web server you still need infrastructure to run your generator, and sometimes that may be non-trivial to set up. I love Docker and isolating the generator using containerization is a really sweet idea. The presence of a Docker image with Jekyll made choosing Jekyll even easier.

Another great thing about Jekyll, is that it is what Github uses for its User, Project and Organization pages, so if you can leave it to them to do both page generation and serve the pages - if you want to.

Setting up your own Github Pages site is easy, and when you’ve generated a Jekyll site locally you can just push it to your Pages repo. If you want a custom domain name (not * there are just a few small things you have to do with your DNS provider, and add a file to your repo.

One nice benefit of using Github Pages is that you get to use Github’s CDN solution, which makes your web page snappier around the world than if you just put your page on some host. (I know this is not a perfect test for this, but you can use a service like 24x7 to check ping from dozens of places around the world, to get a feel for network roundtrip times.)

One of the chief drawbacks of a static site is that there is nowhere to put discussions and feedback, and when using Github Pages no server statistics you can analyze. This was easy to solve adequately for my use; I’ve added Clicky for webstats and Disqus for discussions. I’ve also been careful to add their async JavaScripts so their impact on page loading is kept pretty minimal.

You’ll find the git repo backing this site on Github, where you will see things like how easy it is to add Clicky or Disqus after you have signed up on their sites.

Twitter feedback