I started paying attention to my blog again recently, and wanted to do a couple of changes:
- use https under my own domain
- update it to use a CDN
- use Hugo instead of Jekyll (for faster builds)
Unfortunately, Github Pages does not support having SSL enabled for custom domains, though there is an issue against Github for this feature. There are workarounds, like using Cloudflare for SSL, but this is seems a bit hacky - you don’t even get strict SSL, but instead the connection between Github and Cloudflare is still unencrypted.
Since using Github pages was out of the question, I investigated using my free Azure credits from Microsoft to set all of this up. Such a configuration would use Azure app service, and I even found a handy guide for that scenario online. However, now I was trading the simplicity of Github Pages for having to configure the build hooks myself. When I looked into the way in which I would use Let’s Encrypt to wrap it all up, I became more dissapointed that the only way was with some more manual configuration and an unofficial site extension.
Then I found Netlify. It’s entirely free for the basic features, and includes Let’s Encrypt support built in, and of course the ability to use other git providers such as Gitlab. Even better, your website is backed by their CDN by default, satisfying both of my requirements. They are also coming out with a cool CMS that works on top of static site generators, that I hope to try out soon. It also has the added benefit of supporting Hugo as a first class citizen.
Migrating Jekyll to Hugo
I wanted to change my theme anyway, and my old Jekyll setup was a mess. When looking around, I wanted something that would be very fast and as minimal as possible - I forked a random Jekyll repo previously and it had a bunch of dependencies and code that I was not familiar with. Hugo attracted me by how easy it was to set up themes via submodules. And Hugo is also crazy fast, able to build 5000 posts in seconds.
Fortunately (or unfortunately) my blog did not have many posts, so the migration to Hugo was pretty simple. I just copied over the posts to the relevant
content/post/ folder. The only thing that needed updating besides that was manually specifying the
date in the frontmatter, since Hugo does not currently auto detect that when using the file format
YYYY-MM-DD-slug.md, like Jekyll does, though there is currently an issue open for it.
I won’t go into detail on it, since the excellent Hugo quickstart guide covers pretty much all I did.
From there, setting up Netlify is extremely simple. I used the following guides in order to get it up and running:
The entire experience was streamlined enough that I will probably go the same route when I create other blogs in the future.
2017-03-22 00:00 +0000