For 10 years my blog has been powered by Wordpress, the Content Management System that runs blogs all over the world. But now it was time for a change. I migrated the homepage completely to Hugo, a static site generator. In this article, I want to tell you why I did it and how you can do so as well.

I Needed A Change

For a long time, I was very happy with Wordpress. There are tons of plugins available for each and every use case. I could style my homepage with different themes. I even wrote one myself. And most of this is for free. What else could I wish for?

I guess the thing was that my personal working model and expectations changed. As I wrote more and more articles, I wanted to have a neat and simple workflow. Nowadays I like to write everything in Markdown format. My articles and books usually start as ideas in Obsidian, where they are already in Markdown. Publishing an article meant that I had to copy-paste the article to Wordpress. Then I had to rework links and headings, add metadata, upload the images and so on. That is a lot of clicking to do.

What I really wanted was a way in which publishing an article was fully automated. And that is something that Wordpress did not give me.

But there was more: Wordpress is big and complex, which comes with a lot of drawbacks. It needs constant updates. This can be automated, but then you get a lot of spam for plugins that have been updated.

The admin login page is naturally a target for hackers who try to break in. I did many things to secure this portal: Hide the login, limit number of login attempts, two-factor authentication. I think it worked, but it also made my writer’s experience a little less enjoyable.

All in all, I was spending more time with the publishing process and infrastructure than I liked.

Hugo

I first learned about Hugo in this book about Docker. The authors described a complete build-and-deploy pipeline for their homepage using Hugo. That was what I was looking for! I started to investigate.

Hugo is a static site generator. You feed it with Markdown files and what you get out is a complete homepage with HTML, Javascript and Markdown files. And these files can be easily uploaded to a web hoster using FTP, rsync or other methods.

This should give me a streamlined workflow:

  • I open my IDE;
  • I create a new markdown file;
  • I write my text;
  • I add the metadata in the file header;
  • I build the homepage with Hugo;
  • I run a script to push it to my webserver;
  • Done!

As a bonus, all my articles could be stored in Git. This way, I get versioning for free. Perfect for tracking changes to my articles.

Migrating From Wordpress

I played around with Hugo’s Quick Start Guide and was fascinated by the ease of use and blazing fast build times. There is even a live preview for each and every change. Amazing!

That is when I decided I had to do the change. But how to keep all my existing blog posts and pages? I knew it must be possible, as all contents in Wordpress are stored in the database. But actually extracting it and converting to Markdown seamed like a lot of work.

Luckily, I am not the first one to do this migration. I found the tool WP2Hugo by Ashish Bhatia. With this converter, I was able to convert my Wordpress project into Markdown in a matter of minutes.

I fired up Hugo, looked at the generated page and was astonished how good it looked right from the beginning. I only had to tweek some settings in the file hugo.yaml to get the look I liked and then was already done.

Deploying My Homepage

Next I needed a way to publish my homepage automatically to my web hoster. My web hoster only offers FTP and SFTP as upload methods, so my choice of tools was already limited. I did not want to store a password in my scripts, so I deciced to use SFTP.

I asked Copilot to write a script that builds the homepage and uploads the generated folder /public via the sftp command line tool. This worked, but it had a caveat: It uploaded ALL files every time. This meant the deployment to the server took several minutes even for small changes. With rsync it would have been a breeze, but this was not supported by my hoster. After a little research, I found the solution: rclone.

Rclone supports upload and sync with many different storage technologies in the cloud, even using SFTP. And it can compare checksums of the files on the client and the server, so that it only uploads files that had been changed.

Now the upload to the server is only a matter of seconds instead of minutes.

Another thing that is important before running the upload is to clean the folder /public. I once ran in a situation in which one of my pages was rendered empty without any apparent reason. Cleaning this output folder made it work again.

Isn’t There Something Missing?

Using Hugo is a simplification. That’s why you also lose functions compared to Wordpress, because there is no database.

One thing that Hugo thus does not support are comments by users. It is possible to add this feature using third-party tools. After looking at the numbers, I figured that all in all I only had a handful of comments from real people on my posts, collected over 10 years. On the other hand, there were multiple thousands spam comments (luckily blocked by the Spam filter). Shedding the comments functionality for good was thus not a big loss for me. Most comments now come on my LinkedIn posts anyway.

There is also no contact form functionality, but there seem to be good alternatives like cloak-email that I would like to try. But I most also admit that my existing contact form had been rarely if ever used. Most contacts also now come via LinkedIn.

All in all, what I lose in functionality is something that turns out to have less value than I originally thought. Good that I already had the data to make an informed decision.

My Experience

My site has been running Hugo now for multiple days. One thing I noticed is an amazing speed! The page renders really fast. It is a completely new user experience, and I hope you feel the same way.

The hopes that I had put in this renovation project were far exceeded: Both my writer’s experience and the reader’s experience have reached a new level.

I really recommend Hugo if you are looking to start a blog today. Migrating from Wordpress to Hugo was much simpler than I expected, due to the excellent ecosystem and documentation. And with Copilot, you can extend your homepage any way you like.

Hugo relit the flame of blogging for me, as there are no almost no boundaries any more between writing down my ideas and publishing them.

Stay tuned!