I wanted to have greater control over my blog, so I’ve been thinking about moving it to a self-hosted WordPress installation. In the end, I decided to migrate from WordPress to a static blog generated with Hugo and hosted on GitHub Pages. This post will be the last one posted on reusingthewheel.wordpress.com – the future ones will be posted on piotr-rusin.github.io.
Why a static website generator?
I like the convenience of writing content (including tags, categories and other metadata) in markdown, in my editor of choice, saving it to a file and running a few console commands to rebuild my website and send updates to a server. Static website generators, combined with a couple of Git repositories (one for templates and content and the other for generated static website) and a GitHub account allow me to enjoy it.
Another reason for my choice is that static HTML files can be hosted anywhere, with minimal to no setup. I can even get a reliable, efficient and ad-free hosting for free.
Although no HTML is generated server-side, static website generators still use web templating systems, with all their advantages, like separating data from presentation, allowing me to easily update or replace the latter without having to deal with too much repetitiveness in template code.
Finally, there are security and performance concerns regarding WordPress and other dynamic website engines and web applications (but especially WordPress, judging from both its reputation and popularity). Their complexity and reliance on storing data in database introduce both a potential for bugs that may allow unauthorized access to sensitive data and an overhead in handling HTTP requests. Using a static website generator allows me to avoid these issues without effort.
User interactions and contributions
Choosing the right tool
- its relative popularity – it’s second (after Jekyll) according to data presented on StaticGen
- ease of setup – unlike Jekyll and Pelican, Hugo is distributed as a static binary, ready to be put and executed anywhere
- speed – rebuilding even large websites is said to be much faster than in case of Jekyll
After downloading Hugo, trying it out and using it to do a test migration of my blog, I decided I didn’t need to look further.