↓ Skip to main content

Moving from wordpress to Hugo (a static site generator)

·394 words·2 mins
Steve Root
Author
Steve Root

I’ve just moved my WordPress blog to Hugo, a static site generator. You probably know already if you’re reading this but Static Site Generators take your simply formatted text files and build a web site from them.

Why? A few reasons;

  • I don’t really need a database driven blog with various plugins. My content rarely changes and is pretty simple
  • I don’t need interactivity. Rarely do people comment on this pages and I have an email address on the site for people that would like to reach me.
  • By not having WordPress, I don’t need PHP or a database, which leads to fewer things to maintain… well, almost, I just replaced them with a whole docker container system 😄

Why Hugo?
#

I’d looked at it before. It’s a popular generator. In the process of moving I realised I had tried Hugo before, in June 2020 but I settled on Pelican and wrote about it . I also wrote about 9 months later of moving back to wordpress.

The key change for me this time is finding Sveltia and Decap CMS. They allow me to edit the pages using a web page editor. When I save the new page it automatically generates the new site. I can even upload images like the screenshot at the bottom of this post.

For this to work I had to get a better understanding of Docker Containers and install Forgejo as my own git repository. The ‘Continous Integration’ I’ve read about for years is now something I have. It seems a bit of an overkill to build a new container for every new page but as I type this now, it works. I’ve also wanted to self host my repositories too.

I think I’m going to be using containers more often with my projects, it should make it easier to migrate them between servers. Also new is I can now self host with decent speed from my office network instead of in a datacentre. We have a 5 static IP4 addresses and although I won’t get the five nines of reliability over our fibre line with our level of power cuts, for my hobby things like this blog I can live with the downtime and lower spend.

Anyway, it’s late and I’m writing rubbish, time to go!

A screenshot of the new blog
The new blog using a mostly untouched BlowFish theme and Hugo.