Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jekyll serve '--watch' doesn't work in combination with '--detach'

Tags:

jekyll

This works:

jekyll serve --watch

This will notice any new file in ./_posts and autogenerate the static files

but

jekyll serve --watch --detach

doesn't autogenerate the files. I really want to have autogenerating while running headless.

How to get jekyll working headless and watching new files too?

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

like image 594
Paul Verschoor Avatar asked Apr 06 '14 18:04

Paul Verschoor


2 Answers

Unfortunately, this is a known bug in Jekyll. The release notes said that this would be fixed soon after --detach was implemented, but the bug is still there. For now, I would recommend just using jekyll serve --watch in a separate shell.

like image 187
Nick McCurdy Avatar answered Nov 01 '22 10:11

Nick McCurdy


in jekyll 3.x, when run jekyll with --detach and --watch will get this notice in output:

Auto-regeneration: disabled when running server detached.

a workaround was run jekyll with --watch and detach it by myself:

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

it worked fine for me.

like image 29
yurenchen Avatar answered Nov 01 '22 10:11

yurenchen