Tips for Building a Site with Hugo

The documentation for Hugo is generally very good, but I ran into a few areas where it left me confused, or useful things were missing. I thought I would write up some of things I struggled with (and will possibly add to the official docs).

Some of these were down to migrating from an existing site and wanting to match things like URLs.

Variable Casing

I found it often confusing, sometimes bewildering, as to why certain variables weren’t appearing or evaluating, only to find the casing wasn’t correct.

In the layouts, variables are generally camel-cased (except for parameters in the front matter, which are all lowercase), but then you get things like RSSLink rather than RssLink and BaseURL rather than BaseUrl.

This is also true of the config file used to control the site. I found baseurl to work, rather than baseURL as stated in the docs (although the examples have it all in lowercase). A seemingly missing variable is rssURI, which defines the filename to use for the generated RSS feed (see below) and completely fails all the other ‘standards’ for variable names. Continue reading…

My Attempts at Website Optimisation and the Results

Having decided to move to a static site (using Hugo), I thought I would try and make a few improvements to help boost page loading times and share both my methodology and the results of what I did.

Measuring Progress

I decided to use three different services to track my progress:

  1. Google’s PageSpeed Insights
  2. Web Page Test
  3. GT Metrix

The site would remain on the original host, part of my package supplied by Vidahost, so DNS and server times should be consistent.

Round 1

Removing Unused CSS Styles

I started with a simple one: removing unused CSS styles from the stylesheet. You always end up with unused ones over time, more so in my case as I think I adapted it from a WordPress theme of some sort.

Method: I used the Audit tab in Chrome’s Developer Tools to do this. Continue reading…

Going Static with Hugo

One of the options, when I started looking around for an alternative to my home-brew blogging engine back in 2003/4, was Movable Type. It generated static files each time you hit publish. It was slow and seemed a little antiquated, so I opted for WordPress (then at version 1.2, which shows how long I’ve been using it) because dynamic was obviously the future.

Static is Back

There’s been plenty of noise about the re-rise of static sites lately, mainly due to Static Site Generators — software or engines that take content (often in Markdown format) and some templates and generates plain old HTML files.

There are a number of benefits to this approach that seem to be appealing:

  • You can host it anywhere, every web server and host supports HTML
  • Fewer security concerns to worry about
  • No upgrades to install
  • You can create process flow for versioning and deployment
  • You can write content in your favourite text editor
  • Speed

It’s not like static site generators went away, but with the growth of services that can now be delivered on the front-end (dynamic content, comments, etc) they’re re-emerging as an alternative for certain types of sites. Continue reading…

Reviving My Nexus 7

A while back I was lucky enough to receive a Nexus 7 (2012) as a Christmas present (read my review). I have quite a few tablets and this isn’t my daily driver, but it sits beside my bed as it’s handy to check emails or the weather when I wake up. It’s also great to catch a YouTube video or listen to some songs before settling down for the night. So it gets used every day.

It rarely ventures elsewhere in the house, let along out and about. I prefer the bigger tablets for those sorts of things. Still, it’s a handy addition. That’s why I was becoming a bit disillusioned with its performance.

It started out as super fast and snappy, as you’d expect. It’s a Google device so has got all of the OS updates. Over time it’s become not just slower but almost unusable. It was getting to the point that I was tapping icons multiple times because the delay was so long I didn’t think it had registered. Chrome kept crashing on me too.

I looked at the options to speed it up. Restarts didn’t work for long, if at all. It seemed absurd to simply  write it off and consign it to the rubbish pile. This isn’t an old device. In the end I knew I was going to have to look at a new ROM to help speed it up. Continue reading…

A New Desktop Build

A few months back, my desktop PC died. I had a birthday not too far away and I was struggling with present ideas, so I figured I could make do with a cobbled-together machine until then. Truth be told, I had been thinking about a new machine for a while, mainly because the old one kept hitting a brick wall, I think because of my obsession with keeping a lot of tabs open. So the collapse of the old one presented an opportunity.

My old mini-ITX build was doing the job other than that though. So I was looking at more RAM (my suspicion for the occasional hang-ups) and I also wanted it quieter. The old mini-machine was a little noisy.


I tried to sum up my requirements and I came up with:

  • Quiet
  • Plenty of RAM
  • New SSD
  • Able to drive my 2560×1600 screen and a 1900×1080 second screen, with scope for 4K support in the future
  • Small form factor

I decided I could lose the optical drive.

My experience with my HTPC has taught me two things when it comes to noise:

  • The only silent things have no moving parts
  • A large enough (120mm) fan spinning slow enough may not be silent, but is largely inaudible

So I wanted passive if possible, with maybe a couple of case fans if necessary. Continue reading…