A Hugo static site on Netlify
Introduction
Download hugo-extended
- Adapted from https://gohugo.io/getting-started/installing/
- Go to https://github.com/gohugoio/hugo/releases
- Find the link for your OS. For linux, I'll choose the
.tar.gz
version of v0.75.1
mkdir -p ~/hugo
cd ~/hugo
wget https://github.com/gohugoio/hugo/releases/download/v0.75.1/hugo_extended_0.75.1_Linux-64bit.tar.gz
tar -xvzf hugo_extended_0.75.1_Linux-64bit.tar.gz
rm hugo_extended_0.75.1_Linux-64bit.tar.gz
./hugo version
I already have a ~/.local/bin
folder from installing tfenv
ln -s ~/hugo/hugo ~/.local/bin
source .profile
which hugo
hugo version
- Find a theme from themes.gohugo.io - e.g. Universal theme
- hugo new site
- git sub module
git submodule add https://github.com/devcows/hugo-universal-theme.git themes/universal
- copy
config.toml
, and adjust settings. - Commit
- Make Netlify aware
We have these folders locally:
And yet on GitHub, a shorter list:
From burntfen, we read:
Wait, so why weren’t the other folders - archetypes, content, data, layouts, static - added? Well, they’re empty. Hugo likes empty folders. Git doesn’t. If you want to keep them, you’ll need to add a file into each of them. To do this, you can use a convention of having an empty file called
.gitkeep
Note that my .gitignore
has this
# Hugo default output directory
/public
/themes
So I was able to get around this with
# Hugo default output directory
/public
/themes/resources
/themes/beautifulhugo
Now we have on GitHub:
Ended up adding a hugo module
First, with powershell:
choco install golang
Then we can do:
hugo mod init github.com/halogenica/beautifulhugo.git
And in config.toml
:
theme = "github.com/halogenica/beautifulhugo"