Merge configuration properly. Closes #978.
This commit is contained in:
parent
e7546a98f6
commit
82f32d5c02
|
@ -108,11 +108,10 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns this configuration, overridden by the values in the file
|
# Returns this configuration, overridden by the values in the file
|
||||||
def read_config_file(file)
|
def read_config_file(file)
|
||||||
configuration = clone
|
|
||||||
next_config = YAML.safe_load_file(file)
|
next_config = YAML.safe_load_file(file)
|
||||||
raise "Configuration file: (INVALID) #{file}".yellow if !next_config.is_a?(Hash)
|
raise "Configuration file: (INVALID) #{file}".yellow if !next_config.is_a?(Hash)
|
||||||
Jekyll::Logger.info "Configuration file:", file
|
Jekyll::Logger.info "Configuration file:", file
|
||||||
configuration.deep_merge(next_config)
|
next_config
|
||||||
end
|
end
|
||||||
|
|
||||||
# Public: Read in a list of configuration files and merge with this hash
|
# Public: Read in a list of configuration files and merge with this hash
|
||||||
|
@ -126,7 +125,8 @@ module Jekyll
|
||||||
|
|
||||||
begin
|
begin
|
||||||
files.each do |config_file|
|
files.each do |config_file|
|
||||||
configuration = read_config_file(config_file)
|
new_config = read_config_file(config_file)
|
||||||
|
configuration = configuration.deep_merge(new_config)
|
||||||
end
|
end
|
||||||
rescue SystemCallError
|
rescue SystemCallError
|
||||||
# Errno:ENOENT = file not found
|
# Errno:ENOENT = file not found
|
||||||
|
|
Loading…
Reference in New Issue