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
,YAML
andJSON
, change it at will.
_default
contains the default configurations.production
configurations 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-e
flag. - 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
author
configurations, that is,author.zh-hans.toml
will not take effect. Theconfig
,params
,menu
andmenus
are known that supported multilingual configuring.
Comments