Hugo
Hugo: getting started#
Install#
There are multiple ways to obtain and install - eg: distro package manager, github binary, compile source. Check the docs and choose what works best for you.
I am going with a recent binary:
cd /tmp
wget https://github.com/gohugoio/hugo/releases/download/v0.159.2/hugo_extended_0.159.2_linux-amd64.tar.gz
tar -xzf hugo_extended_0.159.2_linux-amd64.tar.gz
sudo mv hugo /usr/local/bin/
hugo version
Create site#
Here I am working in my git repo which has an existing README.md file, so use –force to create despite the directory not being empty:
cd ~/hugo
hugo new site . --force
Install a theme#
I am using the Terminal theme, which again has multiple installation options.
eg: Raw git clone like: git clone https://github.com/panr/hugo-theme-terminal.git themes/terminal
However best practice is to install as a Hugo module.
Get dependencies#
sudo apt update
sudo apt install -y git golang-go
Init and install#
For the hugo mod init the name doesn’t much matter but use a sane stable one:
hugo mod init ndonaghy.com/hugo
Get the module we want:
hugo mod get github.com/panr/hugo-theme-terminal/v4
RTFM#
Recommended to check the README.md and follow the setup instructions:
https://github.com/panr/hugo-theme-terminal/blob/master/README.md#how-to-configure
Update hugo.toml#
Basics#
baseURL = "http://yoursite.com/"
languageCode = "en-gb"
title = "yourtitle"
Theme via Hugo Modules (do NOT use ’theme = …')#
[module]
[module.hugoVersion]
extended = true
[[module.imports]]
path = "github.com/panr/hugo-theme-terminal/v4"
Create a post#
hugo new posts/first.md
Edit this file and put something in there#
This post is about nothing.
# Nothing
Blah
## Heading 2
- foo
- bar
- baz
Preview your site#
Start server#
hugo server -D
View site#
http://localhost:1313
Modify theme#
To customise your colours in a live preview environment:
- Goto https://panr.github.io/terminal-css/.
- When happy, download the assets and put them in your
static/directory.
Really nice tool.