--replace flag to specify replace directives in go.mod

I have an exampleSite in a module repo that imports the module. Currently, I append a replace directive to the go.mod in exampleSite when I need to make changes to the theme and test them on exampleSite. A --replace flag could do that for us. People who deal with theme files directly have --themesDir and --theme flags to make it easier. --replace could be for modules.

you can set module.replacements via environment variables HUGO_MODULE_REPLACEMENTS

HUGO_MODULE_REPLACEMENTS='...' hugo
2 Likes

@pamubay Thanks, that is indeed what I was looking for!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.