Allow skipping sitemap. Helps #1837

This commit is contained in:
Thomas Reynolds 2016-03-17 13:23:36 -07:00
parent 7484c9f242
commit 5337d0640b
4 changed files with 10 additions and 0 deletions

View file

@ -47,6 +47,8 @@ end
::Middleman::Logger.singleton(3) ::Middleman::Logger.singleton(3)
::Middleman::Cli.config = ::Middleman::Application.new do ::Middleman::Cli.config = ::Middleman::Application.new do
config[:exit_before_ready] = true config[:exit_before_ready] = true
config[:watcher_disable] = true
config[:disable_sitemap] = true
end.config end.config
# Require the Middleman version # Require the Middleman version

View file

@ -23,6 +23,8 @@ module Middleman::Cli
::Middleman::Logger.singleton(2, false) ::Middleman::Logger.singleton(2, false)
app = ::Middleman::Application.new do app = ::Middleman::Application.new do
config[:disable_sitemap] = true
config[:watcher_disable] = true
config[:exit_before_ready] = true config[:exit_before_ready] = true
config[:environment] = opts[:environment].to_sym if opts[:environment] config[:environment] = opts[:environment].to_sym if opts[:environment]
end end

View file

@ -96,6 +96,10 @@ module Middleman
# @return [String] # @return [String]
define_setting :source, 'source', 'Name of the source directory' define_setting :source, 'source', 'Name of the source directory'
# If we should not run the sitemap.
# @return [Boolean]
define_setting :disable_sitemap, false, 'If we should not run the sitemap.'
# If we should exit before ready event. # If we should exit before ready event.
# @return [Boolean] # @return [Boolean]
define_setting :exit_before_ready, false, 'If we should exit before ready event.' define_setting :exit_before_ready, false, 'If we should exit before ready event.'

View file

@ -216,6 +216,8 @@ module Middleman
# rebuild_resource_list! since the last time it was run. This is # rebuild_resource_list! since the last time it was run. This is
# very expensive! # very expensive!
def ensure_resource_list_updated! def ensure_resource_list_updated!
return if @app.config[:disable_sitemap]
@lock.synchronize do @lock.synchronize do
return unless @needs_sitemap_rebuild return unless @needs_sitemap_rebuild