Migrating to Hugo and Netlify

I recently migrated this website from WordPress to Hugo + Netlify. Some thoughts on motivation and process:

Static sites vs. the WordPress CMS

My website is better served as a static site. WordPress is fully featured but has a lot of overhead to support those features. A lot of the plugins I’ve installed disable functionality (ex. Google Analytics, comment sections) that I didn’t want.

Another consideration is security risks. Wordpress requires constant updates to patch jQuery, PHP, etc. whereas static sites’ attack surfaces are limited to the hosting provider and the underlying Git repo. I no longer have to worry about a rogue plugin introducing a site vulnerability.

First-class URLs

Side projects such as Spelling Bee were developed as standalone pages and uploaded to my web host. With WordPress there was no easy way to beautify URLs of uploaded content, leading to URLs like https://jamescalixto.com/site/wp-content/uploads/media/spelling-bee/main.html. With Hugo I can give these files first-class urls — so Spelling Bee is now simply https://jamescalixto.com/spelling-bee/.

Hugo is programmer-friendly

Structuring my website as HTML/CSS/JS + Markdown is leaps and bounds better than WordPress and the database engine it uses. I can manage assets programmatically, use Git for version control, write my own themes and templates — Hugo is perfectly positioned on the simplicity-complexity scale. Its learning curve is very forgiving but it’s robust and extensible enough to manage content with non-trivial taxonomies.

Some documentation is lacking (for example, it took me days to realize that Front Matter can be put into any .html file) but developing with the built-in live server mode gives instantaneous feedback and is perfect for experimenting.

Netlify is also programmer-friendly

Netlify supports continuous deployment from a GitHub repo. Whenever I push changes to the repo, Netlify builds and deploys my website in seconds. Unlike GitHub Pages, I can deploy from a private repository and don’t have to build the site locally first. It’s also free for up to 100 GB/month in bandwidth, which is orders of magnitude higher than what I currently use.

One drawback is the lack of Netlify-native webmail support but I’m using ImprovMX as a forwarder instead.

Migrating my website

I built a theme from scratch to help myself understand Hugo. It was modeled after my existing website, with an emphasis on readability and minimalism, but with added features (ex. visual differentiation between types of posts, dark theme for night reading). Then I migrated posts over in chronological order, checking that links and other elements worked as expected. There were (and still are) minor bugs that I’m trying to iron out, but everything considered migrating to Markdown was mostly painless.

Conclusions

Hugo is great and I should’ve used it for this website from the start. Better late than never!