Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for multiple config files (#2210) #2211

Merged
merged 8 commits into from
Nov 4, 2016

Conversation

pirtleshell
Copy link
Contributor

Give the --config flag support for multiple config files when generating or serving your site.

Inspired by Jekyll as suggested by @Lindsor in #2210.

Usage

List the desired config files (JSON or YAML) in a comma-separated list (no spaces) after the config flag:

hexo server --config config1.yml,config2.json

This will combine all the config files and save the merged settings to _multiconfig.yml. The later values take precedence. It works with any number of JSON and YAML files with arbitrarily deep objects.

For instance, in the above example if foo: bar is in config1.yml, but "foo": "dinosaur" is in config2.json, _multiconfig.yml will contain foo: dinosaur.

@coveralls
Copy link

coveralls commented Oct 17, 2016

Coverage Status

Coverage increased (+0.003%) to 97.13% when pulling dbfd8d9 on PirtleShell:multiconfig into ceee832 on hexojs:master.

@pirtleshell
Copy link
Contributor Author

I'm unable to reproduce the appveyor errors on my machine with the same node and npm versions. This may be a Windows error? Can anyone confirm?

$ npm install
......
$ node -v
v0.12.16
$ npm -v
3.10.8
$ npm test
......
  812 passing (7s)
  7 pending

@NoahDragon
Copy link
Member

I will take a look at it sometime later to see if I can reproduce the error..

@NoahDragon
Copy link
Member

I think this issue is caused by the AppVoyer's user permission. It works fine on my computer.

image

We have to fix it before merging, otherwise, this error will repeat every time.

Could you please try to fix it?

@pirtleshell
Copy link
Contributor Author

I'll see what I can do tonight. In the tests, I check for appropriate warnings by reading the debug log, but it looks like Appveyor doesn't give itself permission to read that file... Thanks for looking into it!

@coveralls
Copy link

coveralls commented Oct 23, 2016

Coverage Status

Coverage increased (+0.005%) to 97.132% when pulling 9b0facc on PirtleShell:multiconfig into ceee832 on hexojs:master.

@coveralls
Copy link

coveralls commented Oct 23, 2016

Coverage Status

Coverage increased (+0.005%) to 97.132% when pulling efe40f9 on PirtleShell:multiconfig into ceee832 on hexojs:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.005%) to 97.132% when pulling c47f4e8 on PirtleShell:multiconfig into afe0bb1 on hexojs:master.

1 similar comment
@coveralls
Copy link

coveralls commented Oct 23, 2016

Coverage Status

Coverage increased (+0.005%) to 97.132% when pulling c47f4e8 on PirtleShell:multiconfig into afe0bb1 on hexojs:master.

@pirtleshell
Copy link
Contributor Author

pirtleshell commented Oct 23, 2016

Well that's aggravating. Many of the Console tests timedout and thus failed.

the failing tests

This PR does not affect the Console submodule. These same tests passed in the previous commit and the only things that changed were some semicolons and new lines added to a test file that happens after the console tests are run.

the previous commit before style edits

I'm just going to force an update and see if it works...

@coveralls
Copy link

coveralls commented Oct 23, 2016

Coverage Status

Coverage increased (+0.005%) to 97.132% when pulling c63a90c on PirtleShell:multiconfig into afe0bb1 on hexojs:master.

@NoahDragon
Copy link
Member

Great work, LGTM.

@NoahDragon NoahDragon modified the milestone: 3.2 Oct 25, 2016
@NoahDragon
Copy link
Member

Tested and works well. Good job!

Usage suggestion:

  1. Run hexo g with config file first;
  2. Then run hexo s with config file accordingly.

E.g.

hexo g --config ./config1.yml ./config2.yml
hexo s --config ./config1.yml ./config2.yml 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants