Fix bug with store rebuilding and proxy resources.

This commit is contained in:
Gregory McIntyre 2016-03-16 12:22:13 +11:00
parent 0904652c6f
commit 563da9d45b

View file

@ -237,7 +237,16 @@ module Middleman
# Rebuild cache # Rebuild cache
@resources.each do |resource| @resources.each do |resource|
@_lookup_by_path[resource.path] = resource @_lookup_by_path[resource.path] = resource
end
@resources.each do |resource|
@_lookup_by_destination_path[resource.destination_path] = resource @_lookup_by_destination_path[resource.destination_path] = resource
end
# NB: This needs to be done after the previous two steps,
# since some proxy resources are looked up by path in order to
# get their metadata and subsequently their page_id.
@resources.each do |resource|
@_lookup_by_page_id[resource.page_id.to_sym] = resource @_lookup_by_page_id[resource.page_id.to_sym] = resource
end end