问题
I installed jekyll and run it from cli:
jekyll --server --auto
But when I change _config.yml
I can't see that my changes where applied and I have to restart server every time.
I really need to restart server every time when I change _config.yml
? Or there is some workaround?
回答1:
I believe you are correct; that changes to _config.yml
always require restarting the server.
After all, _config.yml
provides options that you can override in the call to Jekyll. So it is unclear how auto should behave if an option is called on the command line run of jekyll which overrides some of the _config.yml
settings, and then the config is edited. Which would take precedence then? the _config.yml
or the original command line argument?
回答2:
If you have the server running, you don't need to restart it. A (little bit) quicker way to is to run jekyll build
or bundle exec jekyll build
after editing your _config.yml
file.
回答3:
I really need to restart server every time when I change _config.yml? Or there is some workaround?
There is some workaround:
1) Install watchy.
npm i -D watchy
2) Restart on config change (for example as a package.json
script)
"scripts": {
"restart": "watchy -w _config.yml -- bundle exec jekyll serve --drafts --watch",
(--drafts
is unrelated, but I am assuming you do this locally in dev/authoring mode...)
来源:https://stackoverflow.com/questions/14325445/auto-regeneration-is-not-working-with-config-yml