Zoals de voorbeeldsite laat zien, gebruiken we de Configuratiemap voor een overzichtelijker organisatie en omgevingsspecifieke instellingen. Dit is vooral handig bij meertalige 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 ondersteunt meerdere configuratieformaten: TOML, YAML en JSON; pas dit naar wens aan.

  • _default bevat de standaardconfiguraties.
  • production-configuraties overschrijven de standaardconfiguraties in de productieomgeving.
  • Je kunt ook meer omgevingsconfiguraties definiΓ«ren, zoals development (de standaardomgeving van hugo server), testing, staging. Geef vervolgens de omgeving op met de vlag -e.
  • Configuratiebestanden met een taalcode zijn alleen van kracht voor die taalsite, zoals config.zh-hans.toml. Dit is handig om configuraties en parameters van verschillende talen te scheiden.

De meertalige configuraties werken niet voor author-configuraties; dat wil zeggen dat author.zh-hans.toml geen effect heeft. config, params, menu en menus zijn bekend als ondersteunde meertalige configuraties.