middleman-livereload is an extension for the Middleman static site generator that adds livereloading functionality.
If you're just getting started, install the middleman
gem and generate a new project:
gem install middleman
middleman init MY_PROJECT
If you already have a Middleman project: Add gem "middleman-livereload", "~> 3.4.3"
to your Gemfile
and run bundle install
activate :livereload
The extension supports a number of options that can be given to the activate
statement. Eg:
activate :livereload, apply_js_live: false
Livereload's listener host/port, these options get passed to ::Rack::LiveReload middleware. Defaults:'0.0.0.0'
and '35729'
.
Similar to the :host
and :port
options, but allow you to specify a different host and port at the frontend Javascript level than at the backend EventMachine level. Useful when running behind a proxy or on a Docker VM. Defaults to :host
and :port
.
Whether live reload should attempt to reload javascript / css 'in-place', without complete reload of the page. Both default to true
.
@import
'ed CSS files or require
'd JS files (because of LiveReload not providing enough information regarding dependencies). On those kind of files, a full page reload will be triggered.
Disable Flash polyfil for browsers that support native WebSockets.
Array of patterns for paths that must be ignored. These files will not be injected with the LiveReload script.
String#match
is used for ignoring, so you can use any valid Ruby regular expression in this array.
CSS file to reload when detecting @imported partial was modified. Default stylesheets/all.css
).
To opt out set livereload_css_target: nil
.
Regexp matching filenames that should trigger reload of :livereload_css_target when changed. Default: Regexp.new('_.*\.css')
.
Support secure sockets (WSS) by passing TLS certificate & private key, for
example if you're using middleman server --https
in development.
The official community forum is available at: https://forum.middlemanapp.com
Github Issues are used for managing bug reports and feature requests. If you run into issues, please search the issues and submit new problems: https://github.com/middleman/middleman-livereload/issues
The best way to get quick responses to your issues and swift fixes to your bugs is to submit detailed bug reports, include test cases and respond to developer questions in a timely manner. Even better, if you know Ruby, you can submit Pull Requests containing Cucumber Features which describe how your feature should work or exploit the bug you are submitting.
- Checkout Repository:
git clone https://github.com/middleman/middleman-livereload.git
- Install Bundler:
gem install bundler
- Run
bundle install
inside the project root to install the gem dependencies. - Run test cases:
bundle exec rake test
Click here to lend your support to Middleman
Copyright (c) 2010-2013 Thomas Reynolds. MIT Licensed, see LICENSE for details.