Auto-enable watch on 'serve'.
Addresses @kneath's and @chibicode's comments in #2695.
This commit is contained in:
parent
7de681ef58
commit
6cee2a87cc
2
Rakefile
2
Rakefile
|
@ -146,7 +146,7 @@ namespace :site do
|
||||||
# Generate the site in server mode.
|
# Generate the site in server mode.
|
||||||
puts "Running Jekyll..."
|
puts "Running Jekyll..."
|
||||||
Dir.chdir("site") do
|
Dir.chdir("site") do
|
||||||
sh "#{File.expand_path('bin/jekyll', File.dirname(__FILE__))} serve --watch"
|
sh "#{File.expand_path('bin/jekyll', File.dirname(__FILE__))} serve"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ module Jekyll
|
||||||
c.option 'config', '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
|
c.option 'config', '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
|
||||||
c.option 'future', '--future', 'Publishes posts with a future date'
|
c.option 'future', '--future', 'Publishes posts with a future date'
|
||||||
c.option 'limit_posts', '--limit_posts MAX_POSTS', Integer, 'Limits the number of posts to parse and publish'
|
c.option 'limit_posts', '--limit_posts MAX_POSTS', Integer, 'Limits the number of posts to parse and publish'
|
||||||
c.option 'watch', '-w', '--watch', 'Watch for changes and rebuild'
|
c.option 'watch', '-w', '--[no-]watch', 'Watch for changes and rebuild'
|
||||||
c.option 'force_polling', '--force_polling', 'Force watch to use polling'
|
c.option 'force_polling', '--force_polling', 'Force watch to use polling'
|
||||||
c.option 'lsi', '--lsi', 'Use LSI for improved related posts'
|
c.option 'lsi', '--lsi', 'Use LSI for improved related posts'
|
||||||
c.option 'show_drafts', '-D', '--drafts', 'Render posts in the _drafts folder'
|
c.option 'show_drafts', '-D', '--drafts', 'Render posts in the _drafts folder'
|
||||||
|
|
|
@ -20,7 +20,8 @@ module Jekyll
|
||||||
c.option 'skip_initial_build', '--skip-initial-build', 'Skips the initial site build which occurs before the server is started.'
|
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
|
||||||
|
options["watch"] = true unless options.key?("watch")
|
||||||
Jekyll::Commands::Build.process(options)
|
Jekyll::Commands::Build.process(options)
|
||||||
Jekyll::Commands::Serve.process(options)
|
Jekyll::Commands::Serve.process(options)
|
||||||
end
|
end
|
||||||
|
|
|
@ -211,7 +211,7 @@ module Jekyll
|
||||||
if config.key?('auto') || config.key?('watch')
|
if config.key?('auto') || config.key?('watch')
|
||||||
Jekyll.logger.warn "Deprecation:", "Auto-regeneration can no longer" +
|
Jekyll.logger.warn "Deprecation:", "Auto-regeneration can no longer" +
|
||||||
" be set from your configuration file(s). Use the"+
|
" be set from your configuration file(s). Use the"+
|
||||||
" --watch/-w command-line option instead."
|
" --[no-]watch/-w command-line option instead."
|
||||||
config.delete('auto')
|
config.delete('auto')
|
||||||
config.delete('watch')
|
config.delete('watch')
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue