Jekyll serve '--watch' does not work in conjunction with '--detach'

It works:

jekyll serve --watch 

This will notice any new file in. / _posts and auto-generate static files

but

 jekyll serve --watch --detach 

does not auto-generate files. I really want auto-generation to work without heads.

How to make jekyll work headless and watch new files?

* using jekyll (1.5.1) with ruby ​​2.1.0dev (2013-09-22 trunk 43011) in Debian 3.2.51-1 x86_64 *

+6
source share
2 answers

Unfortunately, this is a known bug in Jekyll. The release notes say that this will be fixed shortly after --detach is implemented, but the error still exists. At the moment, I recommend using only jekyll serve --watch in a separate shell.

+3
source

in jekyll 3.x when running jekyll with --detach and --watch will receive this notification in the output:

 Auto-regeneration: disabled when running server detached. 

The workaround was launched by jekyll using --watch and disconnect it yourself:

 setsid jekyll serve --host 0 --watch --force_polling &>/dev/null </dev/null & 

It worked great for me.

+1
source

All Articles