I am using Hugo modules for my Hugo theme. It would be convenient if I could set it to use my local copy of the theme instead of the stable published version in an env variable, rather than in the go.mod file that is committed to my git repo. I have replacements working in my go.mod like so:
module www.maximumethics.dev go 1.15 require git.sr.ht/~skyfaller/maxethics-hugo v0.0.5 // indirect // To develop locally, uncomment the line below and edit it to point to your local copy replace git.sr.ht/~skyfaller/maxethics-hugo => /home/nelson/code/maxethics-hugo
However, when I try to set the replacement as an env variable, it doesn’t seem to work. Here’s what I’m doing in fish shell:
~/c/content (master)> set -Ux HUGO_MODULE_REPLACEMENTS "git.sr.ht/~skyfaller/maxethics-hugo -> /home/nelson/code/maxethics-hugo" ~/c/content (master)> echo $HUGO_MODULE_REPLACEMENTS git.sr.ht/~skyfaller/maxethics-hugo -> /home/nelson/code/maxethics-hugo
If I comment out the replacement in go.mod after setting that env variable, the site refuses to build because it’s using the stable version of my theme, not the dev version that my local copy is relying on. (I added a new shortcode.) Re-adding the replacement in go.mod makes it work again.
I don’t know where to begin to figure out what I’m doing wrong. Any ideas?