Given file-based metadata precedence over config/path metadata. Fixes #552
This commit is contained in:
parent
0625d96e43
commit
80e36b7c53
|
@ -1,6 +1,7 @@
|
||||||
Master
|
Master
|
||||||
===
|
===
|
||||||
|
|
||||||
|
* Give file metadata (such as frontmatter) precedence over path meta. #552
|
||||||
* Add `sass_assets_paths` option for arbitrary sass partial locations.
|
* Add `sass_assets_paths` option for arbitrary sass partial locations.
|
||||||
* Don't catch CoffeeScript errors when in build mode.
|
* Don't catch CoffeeScript errors when in build mode.
|
||||||
* Extract load_paths so they aren't locked into the binary
|
* Extract load_paths so they aren't locked into the binary
|
||||||
|
|
|
@ -54,13 +54,13 @@ module Middleman
|
||||||
# Get the metadata for both the current source_file and the current path
|
# Get the metadata for both the current source_file and the current path
|
||||||
# @return [Hash]
|
# @return [Hash]
|
||||||
def metadata
|
def metadata
|
||||||
result = store.metadata_for_file(source_file).dup
|
result = store.metadata_for_path(path).dup
|
||||||
|
|
||||||
path_meta = store.metadata_for_path(path).dup
|
file_meta = store.metadata_for_file(source_file).dup
|
||||||
if path_meta.has_key?(:blocks)
|
if file_meta.has_key?(:blocks)
|
||||||
result[:blocks] << path_meta.delete(:blocks)
|
result[:blocks] << file_meta.delete(:blocks)
|
||||||
end
|
end
|
||||||
result.deep_merge!(path_meta)
|
result.deep_merge!(file_meta)
|
||||||
|
|
||||||
local_meta = @local_metadata.dup
|
local_meta = @local_metadata.dup
|
||||||
if local_meta.has_key?(:blocks)
|
if local_meta.has_key?(:blocks)
|
||||||
|
|
Loading…
Reference in a new issue