Playing With Hugo
I got really tired of my WordPress website, so I decided it was time to rebuild the whole thing. Again. I have basically been using it as a static site. In part because I really don’t like using the Gutenberg editor that comes with WordPress.
I have tried static site generators before. In particular Jekyll, which I used for some project sites in my previous job. I have also used Sphinx a great deal for writing documentation. This too for work, but also for my open source project novelWriter. I even recently redesigned the whole website to use Sphinx, not just the documentation. I really like working with Sphinx, but it isn’t really geared towards writing a regular website.
I decided to give Hugo a try.
Ok, so I am not new to Hugo either. I tested it when building those project websites for work that I just mentioned. I landed on Jekyll then mainly so the projects we used them for could use GitHub Pages for hosting, since that was were the code was hosted too.
GitHub Pages supports Jekyll out of the box, although it is pretty easy to set up a GitHub Action
to run the whole build pipeline these days too. I’m not sure exactly when GitHub added that
feature. I tested it out for my open source project, but I already have hosting, so the live site
is just updated with good old
rsync. But it means that it should be fairly straightforward to use
Hugo in combination with GitHub Pages.
I landed on the same workflow for this site as for my open source project. Hugo is available as a package in Debian, so the install was trivial. The build result is just pushed to my hosting with a simple bash script with an rsync command.
Making My Theme
My main trouble with all these static website tools is finding a theme I like. Not that it is much different with WordPress in that respect. My frustration with WordPress themes has always been that there are too many. Most of them are badly written and rarely maintained, or locked up in some subscription service. Even the ones that cost money tend to be clunky to use. Hugo and Jekyll are better spaces, as there is less commercial interest, but themes here too have a tendency to not be well maintained.
In the past, I’ve occasionally made my own WordPress themes for my sites. I decided to do the same with Hugo. I couldn’t find a theme I liked, and in any case I tend to customise them a lot anyway. In the end, it’s actually easier just to build one from scratch.
It’s an added bonus that I’ve learned a lot about how Hugo works in the process. I quite like it actually. It is very flexible, and I’ve found a way to do everything I set out to do.
This theme is probably not complete yet. But I can extend it when I need to, and add the features I want, in the way I want. I’m not going to release the theme itself for others. A part of what makes it easier to build a theme for your own use is that you don’t have to make it customisable for other people’s needs, which means I don’t need as much dynamic logic coded into the templates and less settings in the config file.
… but anyway, here it is: my new website.
You can use your Mastodon account to comment on this post by replying to this thread.
Alternatively, you can copy and paste the URL below into the search field of your Fediverse app or the web interface of your Mastodon server.
The Mastodon integration is based on the implementation by Carl Schwan.