As the example site shown, we use Configuration Directory to maintain easier organization and environment specific settings, it is especially useful on multilingual sites.
1βββ _default
2β βββ config.toml
3β βββ config.zh-hans.toml
4β βββ config.zh-hant.toml
5β βββ languages.toml
6β βββ markup.toml
7β βββ menu.toml
8β βββ menu.zh-hans.toml
9β βββ menu.zh-hant.toml
10β βββ params.toml
11β βββ params.zh-hans.toml
12β βββ params.zh-hant.toml
13β βββ server.toml
14βββ production
15 βββ config.toml
16 βββ params.toml
Hugo supports multiple configuration formats:
TOML,YAMLandJSON, change it at will.
_defaultcontains the default configurations.productionconfigurations will override the default configurations on production environment.- You can also define more environment configurations, such as
development(the default environment ofhugo server),testing,staging. And then specify the environment via-eflag. - The configurations filename with language code affected take effect only on that language site, such as
config.zh-hans.toml, it’s useful to separate configurations and parameters from different languages.
The multilingual configurations doesn’t work on
authorconfigurations, that is,author.zh-hans.tomlwill not take effect. Theconfig,params,menuandmenusare known that supported multilingual configuring.
Comments