Given file-based metadata precedence over config/path metadata. Fixes #552
This commit is contained in:
parent
0625d96e43
commit
80e36b7c53
3 changed files with 9 additions and 8 deletions
|
@ -1,6 +1,7 @@
|
|||
Master
|
||||
===
|
||||
|
||||
* Give file metadata (such as frontmatter) precedence over path meta. #552
|
||||
* Add `sass_assets_paths` option for arbitrary sass partial locations.
|
||||
* Don't catch CoffeeScript errors when in build mode.
|
||||
* Extract load_paths so they aren't locked into the binary
|
||||
|
|
|
@ -37,7 +37,7 @@ module Middleman::CoreExtensions
|
|||
%w(layout layout_engine).each do |opt|
|
||||
data[opt.to_sym] = fmdata[opt] unless fmdata[opt].nil?
|
||||
end
|
||||
|
||||
|
||||
{ :options => data, :page => fmdata }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -54,13 +54,13 @@ module Middleman
|
|||
# Get the metadata for both the current source_file and the current path
|
||||
# @return [Hash]
|
||||
def metadata
|
||||
result = store.metadata_for_file(source_file).dup
|
||||
|
||||
path_meta = store.metadata_for_path(path).dup
|
||||
if path_meta.has_key?(:blocks)
|
||||
result[:blocks] << path_meta.delete(:blocks)
|
||||
result = store.metadata_for_path(path).dup
|
||||
|
||||
file_meta = store.metadata_for_file(source_file).dup
|
||||
if file_meta.has_key?(:blocks)
|
||||
result[:blocks] << file_meta.delete(:blocks)
|
||||
end
|
||||
result.deep_merge!(path_meta)
|
||||
result.deep_merge!(file_meta)
|
||||
|
||||
local_meta = @local_metadata.dup
|
||||
if local_meta.has_key?(:blocks)
|
||||
|
@ -114,7 +114,7 @@ module Middleman
|
|||
return File.open(source_file).read unless template?
|
||||
|
||||
relative_source = Pathname(source_file).relative_path_from(Pathname(app.root))
|
||||
|
||||
|
||||
instrument "render.resource", :path => relative_source do
|
||||
md = metadata.dup
|
||||
opts = md[:options].deep_merge(opts)
|
||||
|
|
Loading…
Reference in a new issue