Use source file, not path, to look up frontmatter data
This commit is contained in:
parent
bf8f02d563
commit
096f5ee356
1 changed files with 5 additions and 1 deletions
|
@ -32,7 +32,9 @@ module Middleman::CoreExtensions
|
||||||
# Modify each resource to add data & options from frontmatter.
|
# Modify each resource to add data & options from frontmatter.
|
||||||
def manipulate_resource_list(resources)
|
def manipulate_resource_list(resources)
|
||||||
resources.each do |resource|
|
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
|
# Copy over special options
|
||||||
# TODO: Should we make people put these under "options" instead of having
|
# 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)
|
data = external_data.deep_merge(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[data, content]
|
[data, content]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue