Merge pull request #1836 from puyo/fix-proxy-metadata-lookup-during-store-rebuild

Fix bug with store rebuilding and proxy resources.
This commit is contained in:
Thomas Reynolds 2016-03-16 10:15:20 -07:00
commit 7484c9f242

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