After deciding to create another personal blog and choosing the technologies, the next step is to build the basic site.

For this I’ve been using a Debian laptop for local Hugo development. Unfortunately, the Hugo version available through the Debain package manager was quite old, so I downloaded the latest release directly from GitHub instead.

From a browser navigate to the Hugo releases page and download the latest .deb package. Then to install Hugo package, run the command (with the updated version number):

sudo dpkg -i hugo_extended_0.xxx.x_linux-amd64.deb

Once Hugo has been installed, which should only take a couple of seconds, create the new site using:

hugo new site MyBlogSite --format yaml

This command forces Hugo to format the configuration file as yaml, as opposed to the default toml. This was chosen as the PaperMod theme, which will be used later, primarily uses yaml for examples in its documentation.

Eventually the site will be hosted on GitLab, so the next step was to initialise a git project.

cd MyBlogSite
git init

One important thing to note is that Hugo does not include a default theme. Without one, Hugo is unable to generate a site for you. One of the benefits of HUGO is that there are a lot of themes to pick from on the Hugo site.

For my usecase, I think that the PaperMod theme is a good starting point. To include this in the project run the commands:

git submodule add --depth=1 https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod
git submodule update --init --recursive
git submodule update --remote --merge

This will download the theme into themes/PaperMod and registers it as a git submodule. When the site is committed to GitLab, git will save a reference to the theme repository rather than copying all of the theme files into the project itself. This also makes it easier to keep the theme up to date with the latest version.

The last part of setting up the theme is to instruct Hugo to use it. This is done by updating the hugo config yaml file, hugo.yaml:

echo theme: [\"PaperMod\"] >> hugo.yaml

At this point the initial, basic Hugo setup should be complete and we can test it locally:

hugo server

This starts Hugo’s local development server on port 1313. Opening http://localhost:1313/ in a browser displays the newly created site, which initially will contain only a dynamic title, My New Hugo Project.