Merge pull request #2477 from jekyll/serve-skip-initial-build
This commit is contained in:
commit
dc074fcc50
|
@ -27,7 +27,11 @@ module Jekyll
|
||||||
options = configuration_from_options(options)
|
options = configuration_from_options(options)
|
||||||
site = Jekyll::Site.new(options)
|
site = Jekyll::Site.new(options)
|
||||||
|
|
||||||
|
if options.fetch('skip_initial_build', false)
|
||||||
|
Jekyll.logger.warn "Build Warning:", "Skipping the initial build. This may result in an out-of-date site."
|
||||||
|
else
|
||||||
build(site, options)
|
build(site, options)
|
||||||
|
end
|
||||||
watch(site, options) if options['watch']
|
watch(site, options) if options['watch']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -75,7 +79,7 @@ module Jekyll
|
||||||
end
|
end
|
||||||
listener.start
|
listener.start
|
||||||
|
|
||||||
Jekyll.logger.info "Auto-regeneration:", "enabled"
|
Jekyll.logger.info "Auto-regeneration:", "enabled for '#{source}'"
|
||||||
|
|
||||||
unless options['serving']
|
unless options['serving']
|
||||||
trap("INT") do
|
trap("INT") do
|
||||||
|
|
|
@ -17,6 +17,7 @@ module Jekyll
|
||||||
c.option 'port', '-P', '--port [PORT]', 'Port to listen on'
|
c.option 'port', '-P', '--port [PORT]', 'Port to listen on'
|
||||||
c.option 'host', '-H', '--host [HOST]', 'Host to bind to'
|
c.option 'host', '-H', '--host [HOST]', 'Host to bind to'
|
||||||
c.option 'baseurl', '-b', '--baseurl [URL]', 'Base URL'
|
c.option 'baseurl', '-b', '--baseurl [URL]', 'Base URL'
|
||||||
|
c.option 'skip_initial_build', '--skip-initial-build', 'Skips the initial site build which occurs before the server is started.'
|
||||||
|
|
||||||
c.action do |args, options|
|
c.action do |args, options|
|
||||||
options["serving"] ||= true
|
options["serving"] ||= true
|
||||||
|
|
Loading…
Reference in New Issue