Store intermediate resources in reducer so the array is not empty the first run. Addresses #1590
This commit is contained in:
parent
60d88139af
commit
5cab7c46a9
|
@ -211,22 +211,23 @@ module Middleman
|
|||
|
||||
@app.logger.debug '== Rebuilding resource list'
|
||||
|
||||
@resources = @resource_list_manipulators.reduce([]) do |result, (_, inst)|
|
||||
newres = inst.manipulate_resource_list(result)
|
||||
@resources = []
|
||||
|
||||
@resource_list_manipulators.each do |(_, inst)|
|
||||
@resources = inst.manipulate_resource_list(@resources)
|
||||
|
||||
# Reset lookup cache
|
||||
reset_lookup_cache!
|
||||
newres.each do |resource|
|
||||
|
||||
@resources.each do |resource|
|
||||
@_lookup_by_path[resource.path] = resource
|
||||
@_lookup_by_destination_path[resource.destination_path] = resource
|
||||
end
|
||||
|
||||
newres
|
||||
end
|
||||
|
||||
invalidate_resources_not_ignored_cache!
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
|
|
Loading…
Reference in a new issue