adaoraul/rack-jekyll

Rebuild automatically in development

axelson opened this issue · 2 comments

I'm using this gem mainly so that I can access my jekyll site in development via pow (pow.cx). Is it possible to rebuild every time or watch for changes (similar to jekyll serve --watch)?

As a work around I am currently bundle exec jekyll build --watch but I'd rather not have to run that separate process.

Add the following the bottom of your config.ru

if ENV['POW_TIMEOUT']
  watcher = fork do
    exec('bundle exec jekyll build --watch')
  end
  Process.detach(watcher)
end

Then set POW_TIMEOUT in your ~/.powconfig file.

Thanks that works great!