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,YAMLenJSON; pas dit naar wens aan.
_defaultbevat de standaardconfiguraties.production-configuraties overschrijven de standaardconfiguraties in de productieomgeving.- Je kunt ook meer omgevingsconfiguraties definiΓ«ren, zoals
development(de standaardomgeving vanhugo 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 datauthor.zh-hans.tomlgeen effect heeft.config,params,menuenmenuszijn bekend als ondersteunde meertalige configuraties.