Make sure Frontmatter data is actually cached. Fixes #903

(Can't return a value to early out of a begin…end expression in Ruby)
This commit is contained in:
Adam Luikart 2013-05-23 14:50:46 -05:00
parent dbbf84016f
commit c60cddc1ac

View file

@ -59,14 +59,16 @@ module Middleman::CoreExtensions
@cache[p] ||= begin
file_data, content = frontmatter_and_content(p)
return [file_data, content] unless @app.files.exists?("#{path}.frontmatter")
if @app.files.exists?("#{path}.frontmatter")
external_data, _ = frontmatter_and_content("#{p}.frontmatter")
[
external_data.deep_merge(file_data),
content
]
else
[file_data, content]
end
end
end