parent
aa8c2466ca
commit
0fde781f2b
|
@ -17,7 +17,13 @@
|
||||||
|
|
||||||
|
|
||||||
- name: Live reload ignore
|
- name: Live reload ignore
|
||||||
description: File glob patterns for LiveReload to ignore.
|
description: >-
|
||||||
|
File glob patterns for LiveReload to ignore.<br /><br />
|
||||||
|
Ensure that patterns are quoted when passed via the command-line to deter your shell from
|
||||||
|
expanding them.<br /><br /><strong>Note:</strong> The given glob patterns are matched against
|
||||||
|
the <code>relative_path</code> attribute of the processed resource. In the event Jekyll
|
||||||
|
reloads a <em>relative_path</em> matching the pattern in spite of being quoted, try listing
|
||||||
|
the pattern(s) under the config file option key.
|
||||||
option: "livereload_ignore: [ GLOB1,... ]"
|
option: "livereload_ignore: [ GLOB1,... ]"
|
||||||
flag: "--livereload-ignore GLOB1[,GLOB2,...]"
|
flag: "--livereload-ignore GLOB1[,GLOB2,...]"
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ module Jekyll
|
||||||
"the server is started.",],
|
"the server is started.",],
|
||||||
"livereload" => ["-l", "--livereload",
|
"livereload" => ["-l", "--livereload",
|
||||||
"Use LiveReload to automatically refresh browsers",],
|
"Use LiveReload to automatically refresh browsers",],
|
||||||
"livereload_ignore" => ["--livereload-ignore ignore GLOB1[,GLOB2[,...]]",
|
"livereload_ignore" => ["--livereload-ignore GLOB1[,GLOB2[,...]]",
|
||||||
Array,
|
Array,
|
||||||
"Files for LiveReload to ignore. " \
|
"Files for LiveReload to ignore. " \
|
||||||
"Remember to quote the values so your shell " \
|
"Remember to quote the values so your shell " \
|
||||||
|
@ -138,7 +138,6 @@ module Jekyll
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# rubocop:disable Metrics/AbcSize
|
|
||||||
def register_reload_hooks(opts)
|
def register_reload_hooks(opts)
|
||||||
require_relative "serve/live_reload_reactor"
|
require_relative "serve/live_reload_reactor"
|
||||||
@reload_reactor = LiveReloadReactor.new
|
@reload_reactor = LiveReloadReactor.new
|
||||||
|
@ -160,7 +159,7 @@ module Jekyll
|
||||||
if @changed_pages && @reload_reactor && @reload_reactor.running?
|
if @changed_pages && @reload_reactor && @reload_reactor.running?
|
||||||
ignore, @changed_pages = @changed_pages.partition do |p|
|
ignore, @changed_pages = @changed_pages.partition do |p|
|
||||||
Array(opts["livereload_ignore"]).any? do |filter|
|
Array(opts["livereload_ignore"]).any? do |filter|
|
||||||
File.fnmatch(filter, Jekyll.sanitized_path(p.relative_path))
|
File.fnmatch(filter, p.relative_path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Jekyll.logger.debug "LiveReload:", "Ignoring #{ignore.map(&:relative_path)}"
|
Jekyll.logger.debug "LiveReload:", "Ignoring #{ignore.map(&:relative_path)}"
|
||||||
|
@ -169,7 +168,6 @@ module Jekyll
|
||||||
@changed_pages = nil
|
@changed_pages = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# rubocop:enable Metrics/AbcSize
|
|
||||||
|
|
||||||
# Do a base pre-setup of WEBRick so that everything is in place
|
# Do a base pre-setup of WEBRick so that everything is in place
|
||||||
# when we get ready to party, checking for an setting up an error page
|
# when we get ready to party, checking for an setting up an error page
|
||||||
|
|
Loading…
Reference in New Issue