How do I go about using Go workspaces with Hugo? I plan to use them to neatly apply replace rules for some of the modules I develop.
I also noticed that relative paths don’t work with the module.workspace
option in config.yaml
.
How do I go about using Go workspaces with Hugo? I plan to use them to neatly apply replace rules for some of the modules I develop.
I also noticed that relative paths don’t work with the module.workspace
option in config.yaml
.
That options just sets the GOWORK
env var used by Go.
As to your first question, my answer is “I’m not sure”. I was rather exited about this when it was released, but I have not had time (or priority) to investigate into how this would work with Hugo.
Thanks for the reply. I just wanted to update the current status workspaces in Hugo, in case anyone might be interested:
module.workspace
needs an absolute pathuse
directive in go.work
for changes. For example, my use case was to debug a theme I’m working on. Hugo would not detect and rebuild the site if I made changes to the theme.My go.work
:
go 1.19
use ../../themes/hugo-yami
Thanks for testing this. Could you copy-paste the above into a GitHub issue. Both of these should be easy to fix.
Also see Make the module.workspace=off as default · Issue #10553 · gohugoio/hugo · GitHub
I’ve created the issue.
I have played a little with work files with the latest source version of Hugo, and now it works really well. As one example, it will greatly simplify my workflow when doing theme updates on the docs site. I will cut a new release before xmas.
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.