问题
As the doc mentions, we should be able to write:
jekyll build --config "_config.yml, _config.en.yml"
Instead, I receive:
Fatal: The configuration file ' _config.en.yml' could not be found.
While the file actually exists.
What am I doing wrong?
回答1:
It's a comma-separated list. You're separating it with a comma and a space.
回答2:
Remove the space after the coma.
jekyll build --config "_config.yml,_config.en.yml"
回答3:
For others coming here and not finding the answer they need:
It could also be that you are running the build script from another folder where the config files are (like a git post-receive
hook)
In which case you'd need to do tweak the example scripts to include the $CONFIG
as follow:
TMP_GIT_CLONE=$HOME/tmp_git/your_domain
GEMFILE=$TMP_GIT_CLONE/Gemfile
PUBLIC_WWW=/var/www/html/your_domain
CONFIG=$TMP_GIT_CLONE/_config.yml,$TMP_GIT_CLONE/_config_dev.yml
git clone $GIT_REPO $TMP_GIT_CLONE
BUNDLE_GEMFILE=$GEMFILE bundle install
BUNDLE_GEMFILE=$GEMFILE bundle exec jekyll build -s $TMP_GIT_CLONE -d $PUBLIC_WWW --config $CONFIG
来源:https://stackoverflow.com/questions/30897871/jekyll-config-multiple-files