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:
parent
dbbf84016f
commit
c60cddc1ac
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue