A Hugo static site on Netlify

Introduction #

Download hugo-extended #

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
git submodule add https://github.com/devcows/hugo-universal-theme.git themes/universal

We have these folders locally:

hugo-local-folders

And yet on GitHub, a shorter list:

hugo-remote-folders

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:

hugo-remote-folders-with-gitkeep

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"

Tagged

🙏🙏🙏

Since you've made it this far, sharing this article on your favorite social media network would be highly appreciated 💖! For feedback, please ping me on Twitter.

Published