A Hugo static site on Netlify

A Hugo static site on Netlify

Introduction

  • Download hugo-extended
  • Find a theme
  • hugo new site
  • git sub module
  • copy config.toml, and adjust settings.
  • Commit
  • Make Netlify aware

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"