8

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?

Viacheslav Kondratiuk
  • 8,493
  • 9
  • 49
  • 81

4 Answers4

10

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?

cynewulf
  • 170
  • 1
  • 7
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.

abc123
  • 8,043
  • 7
  • 49
  • 80
2

Parker Moore, maintainer of Jekyll, confirms that _config.yml changes are not autogenerated or picked up by a running, watching Jekyll server.

No I remember why we can't do this: if you change either source or destination, you're eff'd, so we said to this suggestion. Definitely use _data if you're using custom data. Otherwise, a quick ^C and restart should be

https://github.com/jekyll/jekyll/issues/2302#issuecomment-43160557

pkamb
  • 33,281
  • 23
  • 160
  • 191
0

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...)

Frank N
  • 9,625
  • 4
  • 80
  • 110