Skip to content

Commit

Permalink
add browser-sync support instead of gulp-livereload
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin committed Dec 9, 2016
1 parent 34f0eb2 commit 13c619c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -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"
}
}
14 changes: 13 additions & 1 deletion rakefile
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions readme.md
Expand Up @@ -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

Expand All @@ -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).
Alternatively you may always use your git-fu to non-destructively pull from remotes (`git submodule` is your friend).

0 comments on commit 13c619c

Please sign in to comment.