I’m trying to figure this out and would appreciate any feed back. Basically, I’m moving stuff to repos, and also trying to be more HUGO MODular, but have run into some strange behavior.
I have a repo which will be the main content repo (AKA “the website”). This repo pulls in a theme via mods from a local folder (I know that routing the theme locally rather than via github will be faster/easier for rapid development).
So my main site/config.yml
file looks like:
...
themesDir : ../ #theme folder lives above
module :
imports :
- path : hugo-theme
...
So far, so good (this repo also has a go.mod
and go.sum
file.
“Hugo-Theme” is a repo with a go.mod
and go.sum
file as well as a config.yml
file where I want to pull some dependencies.
In the past I have used Hugo Mods to pull some JS libraries from Github – I use this fro my dependency management. It seems to work well (at least for my use cases).
So, within hugo-theme/config.yml
it looks like this:
module :
imports :
- disable : false
path : github.com/processing/p5.js-website
mounts :
- source : src/assets/js/
target : assets/js/vendor
And, within hugo-theme/layouts/index.html
I have:
{{- $p5 := resources.Get "js/vendor/p5.min.js" -}}
{{- with $p5 -}}<script src="{{ .Permalink }}"></script>{{- end -}}
When I run the site I get the following readout:
$ hugo serve -D --disableFastRender
hugo: downloading modules …
go: finding github.com/processing/p5.js-website latest
go: downloading github.com/processing/p5.js-website v0.0.0-20191128063215-f4e4dec930b8
go: extracting github.com/processing/p5.js-website v0.0.0-20191128063215-f4e4dec930b8
hugo: collected modules in 53101 ms
Error: module "github.com/processing/p5.js-website" not found; either add it as a Hugo Module or store
it in "/.../Documents/GitHub".: module does not exist
Hmmmmmmm…
and the thing is: it all works when the module is listed and imported when it is the in the main site/config.yml
.
I’m not sure whats happening… thoughts?