diff --git a/package.json b/package.json index a15d1f6..086b579 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,8 @@ "url": "http://github.com/binaryage/site.git" }, "dependencies": { + "browser-sync": "^2.18.2", + "bs-html-injector": "git+https://github.com/darwin/html-injector.git", "stylus": "^0.54.2" } } diff --git a/rakefile b/rakefile index 1554c7e..0a58554 100644 --- a/rakefile +++ b/rakefile @@ -454,7 +454,19 @@ task :serve do at_exit do Process.kill('INT', master_pid) # nginx starts in different process group :( end - sys("bundle exec jekyll serve --incremental --plugins \"../.jekyll-plugins\" --drafts --port #{port} -b / --config \"#{config}\" --destination \"#{work_dir}\"") + sys("bundle exec jekyll serve --incremental --drafts --port 1#{port} -b / --config \"#{config}\" --destination \"#{work_dir}\"") + end + fork do + sleep(0.1) + trap('INT') do + exit 12 + end + at_exit do + Process.kill('INT', master_pid) # nginx starts in different process group :( + end + # see https://browsersync.io/docs/command-line + params = '--logLevel info --no-open --plugins "bs-html-injector?files[]=**/*.html"' + sys("cd .. && node_modules/.bin/browser-sync start #{params} --port #{port} --proxy http://localhost:1#{port} --files \"#{work_dir}/**/*.css\"") end end end diff --git a/readme.md b/readme.md index 9e393f5..67f4068 100644 --- a/readme.md +++ b/readme.md @@ -102,9 +102,7 @@ in a second terminal session run the jekyll debug server: rake serve what=www,totalspaces,blog -optionally you may run livereload watcher via gulp in another teminal session - - rake gulp +Note that livereloading and css watching is enabled by default. Using [browser-sync](https://browsersync.io). ### Deployment @@ -118,4 +116,4 @@ Don't forget to push `shared` submodule first if you have modified some shared s If you want to get incrementally to remote state without doing `rake init`, you may reset your repo to remote state via `rake reset` (**will destroy your local changes!!!**). -Alternatively you may always use your git-fu to non-destructively pull from remotes (`git submodule` is your friend). \ No newline at end of file +Alternatively you may always use your git-fu to non-destructively pull from remotes (`git submodule` is your friend).