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?
|
elsif block_given?
|
||||||
@ignored_callbacks << block
|
@ignored_callbacks << block
|
||||||
end
|
end
|
||||||
|
|
||||||
if @ignored_callbacks.size > original_callback_size
|
|
||||||
@app.sitemap.rebuild_resource_list!(:added_ignore_rule)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Whether a path is ignored
|
# Whether a path is ignored
|
||||||
|
@ -74,13 +70,6 @@ module Middleman::Sitemap::Extensions
|
||||||
path_clean = ::Middleman::Util.normalize_path(path)
|
path_clean = ::Middleman::Util.normalize_path(path)
|
||||||
@ignored_callbacks.any? { |b| b.call(path_clean) }
|
@ignored_callbacks.any? { |b| b.call(path_clean) }
|
||||||
end
|
end
|
||||||
|
|
||||||
# Update the main sitemap resource list
|
|
||||||
# @return [void]
|
|
||||||
def manipulate_resource_list(resources)
|
|
||||||
# No op
|
|
||||||
resources
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -48,7 +48,9 @@ module Middleman::Sitemap::Extensions
|
||||||
|
|
||||||
def get_source_file
|
def get_source_file
|
||||||
if proxy?
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -29,11 +29,6 @@ module Middleman::Sitemap
|
||||||
|
|
||||||
# Proxies
|
# Proxies
|
||||||
register_resource_list_manipulator(:proxies, @app.proxy_manager, false)
|
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
|
end
|
||||||
|
|
||||||
# Register a klass which can manipulate the main site map list
|
# Register a klass which can manipulate the main site map list
|
||||||
|
|
Loading…
Reference in a new issue