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*
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With