GitHub Workflows
As I’m getting back into the swing of writing posts for my website, I decided to set up a GitHub workflow to automatically build my site on the server. This makes it very easy to update it. I used this script from Luke Smith’s theme as a starting point to let GitHub SSH into the server.
Hugo - RSS & Page Tweaks
Hugo already made an RSS feed for my site without me realising, though it was set to do it for all pages and only show summaries. So I copied the RSS template from the source code to make my own. I didn’t change much, just changing the summary to the actual content and the date format.
As well as that I’ve managed to use a section layout instead of individual list layouts for the /about and /links pages. This is just to streamline things, because if there are any other pages I don’t want them listed, and I don’t want to have to make a new layout each time I make a new page under a different folder. Also I added last modified dates to the bottom, these use the ones from Git, which work automatically provided you have enableGitInfo = true
in your hugo.toml. You can then use {{ .Lastmod }}
in your templates to refer to them. You can then adjust the date format if you want too. I’ve “promised” to myself that I don’t get hung up on perfecting old articles, though I think they are useful for pages that I plan to update like about or links.
Site Optimisations
I also plan on some server side optimisations, inclusing caching things like the CSS and page compression. I think my site already loads very fast, even when I’m using it on my phone or another computer, but it’s probably worth it for the future.
Hugo Appreciation Society
The best thing about Hugo is that once I’ve written the content, I can change anything that I want about all the pages without having to edit all the HTML myself. Even though I do know enough HTML to get by, Hugo is much easier than potentially using a bunch of shell scripts to build a website. Potentially I would have written my own system to do something like that, because the learning curve for Hugo felt too big initally, though I have decided to learn as I use it.
At the same time, I don’t know much about web development, and it’s not a field I plan to work in, so most of the inspiration for the layout comes from looking at other sites. Perhaps as I add more content it would make sense to adjust the page layouts to suit it better. Sometimes I wish I had a CMS to write my posts with, which would make page manipulation easier, but I would also miss vim. Writing Markdown isn’t that hard either.