Update: I’ve since switched to the PaperMod Theme

I’m sick of maintaining Wordpress. I’ve finally decided to switch to a static site using Hugo.

Hugo Setup

Install Hugo

I’m using the DoIT Hugo theme. This requires Hugo Extended.

Installation via Chocolatey

choco install hugo-extended

Create a new site

Hugo will create a new site named <my-site>

hugo new site <my-site>

Install a theme

I like the simplicity and aesthetics of the DoIT theme.

Create a git repository and make the CodeIT repo a submodule of the side directory.

cd <my-site>
git init
git submodule add https://github.com/HEIGE-PCloud/DoIt.git themes/DoIT

I must be doing something wrong. Sometimes, on new computers, the themes module doesn’t load properly. In this case, I run the following commands. (At some point I need to read the docs properly).

git rm --cached themes/PaperMod
# remove contents of .gitmodules
rm -force .git/modules/themes
git submodule add --depth=1 https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod

Configure the site

In the root of the site, Hugo will create a config.toml file. Here is an example:

contentDir = "content"
layoutDir = "layouts"
publishDir = "public"
buildDrafts = false
baseURL = "https://yoursite.example.com/"
canonifyURLs = true
title = "My Hugo Site"

[taxonomies]
  category = "categories"
  tag = "tags"

[params]
  subtitle = "Hugo is Absurdly Fast!"
  author = "John Doe"

Create a new post

Hugo will create a new post in the content\posts directory.

All posts are formatted in Markdown.

hugo new posts/my-post.md

Run Local Dev Server

hugo serve

Deploy to Github Pages

Follow the instructions here to create a new Github Pages site.

Automate Deployment with Github Actions

Follow the instructions here to set up a Github Action to build and deploy Hugo sites.