Configuration#add_default_collections: fix bug where DEFAULTS['collections'] is modified

This commit is contained in:
Parker Moore 2016-04-08 10:49:08 -07:00 committed by Pat Hawks
parent d01f7943de
commit f52a0e7200
1 changed files with 7 additions and 5 deletions

View File

@ -297,11 +297,13 @@ module Jekyll
config['collections'] = Hash[config['collections'].map { |c| [c, {}] }]
end
# Add posts.
config['collections']['posts'] ||= {}
config['collections']['posts']['output'] = true
config['collections'] = Utils.deep_merge_hashes(
{ 'posts' => {} }, config['collections']
).tap do |collections|
collections['posts']['output'] = true
if config['permalink']
config['collections']['posts']['permalink'] ||= style_to_permalink(config['permalink'])
collections['posts']['permalink'] ||= style_to_permalink(config['permalink'])
end
end
config