Why the same settings from configure folders can't override by selected environment?

I think that the Hugo’s configuration directory designed were very powerful, in the document write that will merge two different environment settings when run hugo server command, but the action result wasn’t I wanted.

Let me show you the coding , such as below:

configuration directory

├── config
│   ├── _default
│   │   ├── config.yaml
│   └── develop
│      └── config.yaml

In the _default/config.yaml file there were set some parameters which use for comments, such as below:

     enable: true
       el: "#wl-container"
       pageView: true
       # This flag will be replace when deploy to Github pages through Github action.
       serverURL: "#{wl-backend-server}"

then create develop/config.yaml file there were set same comment parameters which use for develop in local, such as below:

       serverURL: "https://waline.js.org"

So I hoped the develop environment settings which parameter’s name called serverURL will merged (Override) the default setting, but actually that not. It was still used the default setting, why?

Do you had same problement?

I am unable to reproduce the problem.

When I run hugo the value is obtained from config/_default/config.yaml.

When I run hugo -e develop the value is obtained from config/develop/config.yaml.

Perhaps you meant to name the directory development instead of develop, so that you do not have to specify the environment flag when running hugo server.

1 Like


Yeah that were so strange, I used your hugo-testing repository try to reproduce it but not successe, and I will check my theme develop code again and reply the result next time as soon as possible.

@jmooring Sorry, It’s my mistake that found it wasn’t write in params position, then after I rewrite all override settings into development/params.yaml file that work well.

Thanks again.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.