How to write the site configuration in yaml format for the multi-level menu?

I have read the docs

excuse me
1.
How should multi-level related menus be written in multiple languages?
in yaml format
for example:
demo menu, there are login and registration menus below,
Login menu, with account login and phone number login
Registration menu, with account registration and mobile phone number registration
So how should the multi-level menu in yaml format be written?


Another question, what does this internal and external mean?

Or give a toml file format of the multi-level menu, and I am very happy to convert it myself.
If it is convenient, please update the documentation in the relevant location to solve this kind of problem once and for all.

  • External menu entry goes to e.g. “https://www.google.com/”
  • Internal menu entry is to any of the pages on the same site, e.g. to “/about/”

To set up multilevel menus you use the “parent” property to set the parent of the menu item. Parent value can be name or identifier of the parent item.

For multilingual menus see Multilingual Mode | Hugo.

When multiple multi-level menus are included, the menu configuration will become very long, which is not conducive to secondary reading and maintenance. Is there any good way?
Is there a good article introduction that I can read?

If you want to define menu entries in site configuration, then you need to place the menu entries in site configuration—you can’t change that. You could move the entries to a separate configuration file (e.g., config/menus.toml).

Depending on the nature of your menus, you might be able define menu entries in front matter, requiring nothing in site configuration. Although the entries are not centralized, it can make localization easier.

If a given menu is based on the hierarchical structure of your content files, you could recursively walk the content to build a section menu.

1 Like