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

Fix bug with store rebuilding and proxy resources.
feature/manifest
Thomas Reynolds 2016-03-16 10:15:20 -07:00
commit 7484c9f242
1 changed files with 9 additions and 0 deletions

View File

@ -237,7 +237,16 @@ module Middleman
# Rebuild cache
@resources.each do |resource|
@_lookup_by_path[resource.path] = resource
end
@resources.each do |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
end