Auto regeneration is not working with _config.yml?

蓝咒 提交于 2020-01-04 04:24:08

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!