Use source file, not path, to look up frontmatter data

This commit is contained in:
Ben Hollis 2014-05-30 21:50:10 -07:00
parent bf8f02d563
commit 096f5ee356

View file

@ -32,7 +32,9 @@ module Middleman::CoreExtensions
# Modify each resource to add data & options from frontmatter.
def manipulate_resource_list(resources)
resources.each do |resource|
fmdata = data(resource.path).first
next if resource.source_file.blank?
fmdata = data(resource.source_file).first.dup
# Copy over special options
# TODO: Should we make people put these under "options" instead of having
@ -76,6 +78,8 @@ module Middleman::CoreExtensions
data = external_data.deep_merge(data)
end
[data, content]
end
end