Open fmunteanu opened 5 months ago
There's two aspects of this:
menus
is shallow
(see https://gohugo.io/getting-started/configuration/#merge-configuration-from-themes). You can change that in your project
setting ... but:slices
(which is the main
menu in your example). This has been discussed, but that cannot be done without additional information.@bep thank you for the response. From your perspective, what changes should I apply to hugo.yaml, in order to achieve the intended result? I even tried changing from menus.main
to menus.project
(see PR) but Hugo does not understand the differences, at build time, propagating the new menus everywhere, instead of seeing them unique only for /docs/project directory, as intended. I believe this is happening because Hugo combines all imported module configurations and picks the last found values.
The navbar.html template uses a $menu
variable to easily determine the correct menu used. Do I need a specific module.mounts
definition?
I believe this is happening because Hugo combines all imported module configurations and picks the last found values.
With merge strategy shallow
(which is the deep), Hugo walks the dependency tree starting from the project
and merges the menu configurations shallowly, the first entry wins.
So, if you have project -> module1 -> module2
And
a
, b
b
, c
b
, c
, d
We use project.{a,b}, module1.b and module2.d.
I'm pretty sure that works as described.
@bep I'm still not sure what changes I need to perform, in order to achieve the scoped end-results. Right now I have the following mounts on /project/hugo.yaml module:
module:
mounts:
- source: content
target: content/project
- source: layouts
target: layouts/project
- source: public
target: public/project
- source: static
target: static/project
While executing the build command at the root of repository:
hugo --gc --minify -s ./docs
The end-result should be:
/
final build navbar/project
final build navbar
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes.
Current Issue
I've been struggling with this issue for a while, without any resolution. The discussion started on forums did not yield any positive outcome, so I'm reaching at Hugo developers, to determine if my end-goal is achievable with Hugo.
My current Hugo website consists of following files structure, see testing repository:
My goal is to have specific website titles and menus imported from Hugo modules, at build time. In other words, when I build the website, I expect the following end-result:
/docs
should display the menus present into /docs/hugo.yaml/docs/project
should display the menus present into /project/hugo.yamlThank you for providing feedback to my current issue.