现在可以在第二个终端窗口中使用Guard-livereload来获得LiveReload工作运行防护.这基本上与 Jan Segre的答案相同,但没有guard-jekyll.我的Guardfile看起来像这样:guard 'livereload' do watch(/^_site/)end还有我的Gemfile:gem 'jekyll'gem 'guard'gem 'guard-livereload' 注意:您仍然需要在index.html页面中包含livereload脚本;是将guard-livereload和浏览器绑定在一起的胶水".<script src="http://localhost:35729/livereload.js"></script>I'm getting started with Jekyll static site generator and I would like to use Live Reload with it. I know Jekyll has a generator and server commands, and Live Reload can run various compilers and custom commands. How do I configure these to work together? 解决方案 The simplest approach I've found that works is to use two terminal windows: One for jekyll serve --watch and one for guard.I tried the guard-jekyll-plus approach suggested by Nobu but I had a bunch of errors.As shumushin pointed out, Jekyll can handle the automatic rebuilding process, you simply launch it using jekyll serve --watchNow to get LiveReload working run guard with guard-livereload in a second terminal window. This is basically the same as Jan Segre's answer, but without guard-jekyll.My Guardfile looks like this:guard 'livereload' do watch(/^_site/)endAnd my Gemfile:gem 'jekyll'gem 'guard'gem 'guard-livereload'Note: You still need to include the livereload script in your index.html page; it is the "glue" that binds guard-livereload and the browser together.<script src="http://localhost:35729/livereload.js"></script> 这篇关于与Jekyll一起使用Live Reload的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-15 11:23