Can you chain multiple configs together?

This is something that I’ve used quite heavily with Jekyll, where you have one config file for local dev, one for production and maybe one for staging. In Jekyll this is nice because it allows you to allow drafts, limiting it to only generate the last 15 posts etc and then when you want to publish it you use jekyll build --config dev.yml,prod.yml and the settings in prod.yml would override those in dev.yml so it will skip drafts, generate all posts and so on.

I tried the same with Hugo using the --config=dev.yml,prod.yml but it throws me these errors:

$ hugo --config=dev.yaml,prod.yaml
$ ERROR: 2015/06/05 Unable to locate Config file. Perhaps you need to create a new site. Run `hugo help new` for details
$ ERROR: 2015/06/05 No 'baseurl' set in configuration or as a flag. Features like page menus will not work without one.

Even though I am specifying a config and have baseurl set in one of them. Curious if this is possible. Cheers!

1 Like

Re. docs:

config file (default is path/config.yaml|json|toml)

So, one file. I agree it would be useful.