Are there any advantages to using Go Modules vs git submodule for something like installing a theme? Wondering what the recommended way is going forward. Asking from two perspectives:
Should I migrate existing sites to use Modules (if the theme is set up correctly for go modules)?
Should the Quickstart instructions use Go Modules instead of a git submodule if that’s the recommended way?
Thanks, been looking over the Modules docs but missed that. I’m sure there’s a lot of users that install hugo without installing golang, if documenting something I’ll prob go the git submodule way.
Yea, I’m in the same boat with occasional use of many things, actually the reason for the new site that’s behind this question!
While that is true for when you’re doing “theme development”, once it is stable you can do “hugo mod vendor”.
We do that for the Hugo Docs and the Hugo Themes site (we only have one module there, the theme, but the concept is valid), which give us 2 benefits:
Users who want to run the docs site locally only need Hugo installed (no Git, no Go)
The repo has everything needed to run the site committed to GitHub – meaning we can include the full docs site source (with theme etc.) in the /docs folder of the Hugo main project in the source distribution. Meaning you can the download v0.56 source and browse the docs at that point, without having to download anything more.
Thanks for the heads up, I’m that much closer to grokking modules. I suppose I could go hunting on GitHub for repos with modules, I haven’t seen many examples in the wild, so nearly everything I’ve learned is from one of your example repos or a comment here; slow and steady.