Hi, This documentation is looking pretty good, but there are a few things:
Does my site need to be a Git Repo?
Having your website in a Git repository is not necessary for Hugo Modules to work – it can even be local files on your computer.
The key is that your site needs to be a Hugo Mod itself, which only means that it has a go.mod
file in its directory. This doesn’t need to look any more special than:
module website
go 1.12
NB there might be some restrictions about slashes at start / end of name.
Does theme = ...
still matter?
The distinctions here are a little ties up in multiple changes in Hugo including:
- see: Hugo Theme Components which are tightly coupled to Hugo Mods.
- Hugo’s defaults + “smartness” : Hugo Mods
import
will, by default, import things into your site’s/theme
directory and guesses that you want to apply these themes to your website build - see: this thread and this thread where i’m playing around with different ways to pull in themes (with and without mods) note that there might be some different behavior with
.yaml
vs.toml
TLDR: yes and no
theme = ...
isn’t dead and might have multiple uses :
- A Guess : you could shape the Theme Inheritance
- I use Hugo Module Mounts to mount a theme directory and then use
theme = ...
to select the theme(s) that I want to render with.
@bep correct? or have I massively misled people?