The Hugo Docs state:
Instead of a single site configuration file, split your configuration by environment, root configuration key, and language.
For example:my-project/ └── config/ ├── _default/ │ ├── hugo.toml │ ├── menus.en.toml │ ├── menus.de.toml │ └── params.toml ├── production/, giving you └── params.toml
The root configuration keys are:
build
,caches
,cascade
,deployment
,frontmatter
,imaging
,languages
,markup
,mediatypes
,menus
,minify
,module
,outputformats
,outputs
,params
,permalinks
,privacy
,related
,security
,segments
,server
,services
,sitemap
, andtaxonomies
.
The , giving you
after production is on the site, but I think it’s just noise.
Regardless; The verbiage could be misinterpreted, and I’d rather make sure I understand the ways this may be done.
What I believe is the guidance is:
- Use Directories for environments.
- You may split the config into files, per root key.
I’m not sure if:
- you may split the config into files by root key in a non-uniform fashion across directories
- if your site is multilanguage enabled
- should/should’t/may not/ use directories for languages
- if you should use directories
- should languages be children of environments?
- should environments be children of languages?
- if you should use directories
- should/should’t/may not/ use directories for languages
I get that it depends… to some extent… but I’m trying to avoid being unnecessarially dense
is something that’s stored in config/_default/hugo.yaml
:
# config/_default/hugo.yaml
baseURL: 'https://myawesomesite.whatever.example.com'
taxonomies:
stuff: stuffs
thing: things
permalinks:
stuff: "/:section/:year/:month/:day/:title"
expected to be overwritten in say… the production environment?
config/production/taxonomies.yaml
:
# config/production/taxonomies.yaml
post: posts
stuff: stuffs
product: products
series: series
tag: tags
config/production/permalinks.yaml
#config/production/permalinks.yaml
stuff: "/:section/:year/:month/:day/:title"
product: "/:section/:year/:month/:day/:title"
series: "/:section/:year/:month/:day/:title"
I’ve noticed in the past that if something is in a subelement of the _default/hugo.yaml
, not split out in its own, that consumption of values in sub-files of an environmental subdirectory were… odd…
(( admittedly this was several versions ago, and likely has been fixed… but muscle memory… ))
so now that I’m starting something clean, I wanted to assess what’s considered the “right” way to split this out now…
I looked here, and on the docs site, but I didn’t see a clear statement indication as to what’s considered the “right” way to do this at the moment
(because there’s rarely ONE right way… but… yea there are DEFINITELY several wrong ways… which I’ve done many of )