Get rid of some extraneous sitemap refreshes
This commit is contained in:
parent
ab77cb2f34
commit
35037957a6
|
@ -61,10 +61,6 @@ module Middleman::Sitemap::Extensions
|
|||
elsif block_given?
|
||||
@ignored_callbacks << block
|
||||
end
|
||||
|
||||
if @ignored_callbacks.size > original_callback_size
|
||||
@app.sitemap.rebuild_resource_list!(:added_ignore_rule)
|
||||
end
|
||||
end
|
||||
|
||||
# Whether a path is ignored
|
||||
|
@ -74,13 +70,6 @@ module Middleman::Sitemap::Extensions
|
|||
path_clean = ::Middleman::Util.normalize_path(path)
|
||||
@ignored_callbacks.any? { |b| b.call(path_clean) }
|
||||
end
|
||||
|
||||
# Update the main sitemap resource list
|
||||
# @return [void]
|
||||
def manipulate_resource_list(resources)
|
||||
# No op
|
||||
resources
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -48,7 +48,9 @@ module Middleman::Sitemap::Extensions
|
|||
|
||||
def get_source_file
|
||||
if proxy?
|
||||
store.find_resource_by_path(proxied_to).source_file
|
||||
proxy_resource = store.find_resource_by_path(proxied_to)
|
||||
raise "Path #{path} proxies to unknown file #{proxied_to}" unless proxy_resource
|
||||
proxy_resource.source_file
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -94,4 +96,4 @@ module Middleman::Sitemap::Extensions
|
|||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -20,7 +20,7 @@ module Middleman::Sitemap
|
|||
def initialize(app)
|
||||
@app = app
|
||||
@resources = []
|
||||
|
||||
|
||||
@_lookup_cache = { :path => {}, :destination_path => {} }
|
||||
@resource_list_manipulators = []
|
||||
|
||||
|
@ -29,11 +29,6 @@ module Middleman::Sitemap
|
|||
|
||||
# Proxies
|
||||
register_resource_list_manipulator(:proxies, @app.proxy_manager, false)
|
||||
|
||||
# Ignores
|
||||
register_resource_list_manipulator(:ignores, @app.ignore_manager, false)
|
||||
|
||||
rebuild_resource_list!(:after_base_init)
|
||||
end
|
||||
|
||||
# Register a klass which can manipulate the main site map list
|
||||
|
|
Loading…
Reference in a new issue