Hi,
Since I’ve grown to have a number of intercommunicating sites, I’ve been interested in sharing elements of configuration and templating. Mounts have been part of my workflow for a long time but I haven’t found a use or the courage to learn modules, and they ran out of fashion or so I read.
I do only/mostly local developments, and there is too much writing involved in replacements but workspaces seem to do exactly what I need. One place to refer to everything. But the documentation is very scant and I am no Go developper.
Could you help with this simple case ?
So I have this module, common-hugo-module, both the name of the directory and the path/go identifier. On the same directory, all my separate projects are present, and hugo.work, which contains:
go 1.19
use .
use ./common-hugo-module
For now I just run HUGO_MODULE_WORKSPACE=../hugo.work hugo server on one of the project under the same directory, it watches work.go… But ignore the directives and the module.
What more must I do ?
I need this to share config and renderhook (so that each site can be language-aware when emitting links to anothe site, in a multilingual setting). It seemed a logical approach, though one I’m new to.
I understand what it does now… Not pulling any dependencies, the workspace just centralizes replacements directives for go, so every project has to list the modules it wants regardless. Well, I’m not sure I have a use for it.
Also, the merging rules for configuration values are not intuitive, to say the very least. Which is sad as it was one of the things I meant to share.
Is there any way a project can access the page listing of another, in order to resolve URLs for pages or content on said other project ?
Can you tell me, because I couldn’t find the info from the doc, can a module imports a new language (not mentioned at all in the project’s config) ?
Going in another direction, I tried turning my epub generator into a module, with its config file meant to define the “epub” environment. The file is charged, but though I add “_merge: deep” everywhere, some things are merged, some aren’t.
So far “defaultoutputform: xhtml” is not merged, nor is the entire [outputs] section. If I can’t override what kind of file is created depending on the environment target, I can not implement this project in a module either.