How to modify specify menu on dev env?

Hi, I’m creating a monorepo for multiple sites, I run multiple sites on local, and I want to change some menu URLs to local development URLs. For example

$ tree config
config/
  _default/
    menu.yaml
  development/
    menu.yaml

_config/default/menu.yaml

main:
  - name: Icons
    identifier: icons
    url: https://example.com/

  - name: Modules
    identifier: modules

  - name: Projects
    identifier: projects

config/development/menu.yaml

main:
  - name: Icons
    identifier: icons
    url: http://localhost:13131/

I expect that Hugo will deeply merge those menus, but the Modules and Projects menus were gone, is it expected? Is there any way to avoid repeating all menus for development env?

Yes, array is not merged by Hugo.


1 Like

Thanks for the reminding, I forgot this. I keep this open to see if there are any solution to achieve this.