Can't get cast menu maps

So I had read this Cannot get hugo to cast menu maps but do not understand everything.
What I understood is that putting alla config files together into one config.toml will work… ans it does.
But, I want to split it into several ones into the configDir/_default

What shall I do for this to work ?

Each file represents a configuration root object, such as params.toml for [Params], menu(s).toml for [Menu], languages.toml for [Languages] etc…

Take the menu as an example.

title: Hello

    - name: Foo
    - name: Bar

Equals to

title: Hello
  - name: Foo
  - name: Bar

You’ll notice that there isn’t a menu key in config/_default/menu.yaml.

Learn more on Configuration Directory.

Thanks for your reply.
I think I did it right…
Structure :

And into the files :

config.toml :

configDir = 'config/'
languageCode = "fr-FR"
defaultContentLanguage = 'fr'
defaultContentLanguageInSubdir = false (That one might be set to  true  I think.... ? I have organise the /content with content/fr and content/en)


      weight = 0
      languageName = "Français"
      contentDir = "content/fr"
      title = "tittre Français"
      weight = 2
      languageName = 'English'
      contentDir = 'content/en'
      title = "Title English"

======================== avoid [[languages]] then

	name = 'Services'
	url = 'fr/pages/services/'
    weight = 1

    name = 'Projets'
    url = '/fr/projets'
    weight = 2

You’ll notice that there isn’t a menu key in config/_default/menu.yaml.

Do you mena I shall remove, not only [[languages]] but even the [[]] ? The name of the file is enough to say this menu is in french ?


Similar to the menu.yaml, it’s no need to specify the root key of the corresponding configuration file.

For example, the languages.toml should be:


name = 'Services'

name = 'Projets'

Real examples of my sites: in YAML and in TOML

Thanks my understanding of the whole staff improved a lot.

I thinks things are working now because hugo send back an error about the headings, which include the menu. So I guess it processes the menus properly now.

I would have another question about configuration : on your theme, the config.toml file itself is included into the /config/default. Does it means that, out of themes, the root of the site itself don’t need a config.toml out of the configDir ? And, why not using hugo.toml ? (may be you disegned your theme for version older than 0111, right ?

Yes, requires Hugo >= v0.110.0, see hugo.toml vs config.toml.