jekyll 3.0.3 → 3.0.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of jekyll might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8d95eee0017fdee0b1bd50cd4ecd98ce21c1c93
4
- data.tar.gz: 01041195decd799ee53f3f789a198e77a4fa64c4
3
+ metadata.gz: 98ba3fa55cb0c26a1d2a7e7e6dc1bef322f54e75
4
+ data.tar.gz: 37ed86cfd716d25d054bc3401d7213a2bbb14ea8
5
5
  SHA512:
6
- metadata.gz: 2db44561c9c9a3c0e2ab910c001bdf10f5666eea637897d3ab84ca99964826bac9198de11a9d6ca4444d0928463d6f3d6591abf3e8b498aef9a138475800fe22
7
- data.tar.gz: 63f973c0b2cd718f45076b6813cfa3acebf8eed763775ee335dfc670ab6079b5b16fb686d2265c41c2a67201af4dd46df3777a21976e8a8dfc1f27a14a1406c4
6
+ metadata.gz: 8d2b0d3e0f6f478dbeac2242463226b9f58ee1e52ef274ce9a6361eabd4f5d877a95b6bda6e80be1fab597737d1b2c9bcbe184af2e89c7c0d2692288c87733d4
7
+ data.tar.gz: 49a95f70354cd9bce8fa4bdca2690d6bf291a4046b2265b84c7ebc220637b2aa3a0ec82426811b83e521dc64f3beeb6583a2342e9120bd3f057cdce4ed46acb9
@@ -96,14 +96,13 @@ module Jekyll
96
96
  #
97
97
  # Returns the final configuration Hash.
98
98
  def configuration(override = Hash.new)
99
- config = Configuration[Configuration::DEFAULTS]
100
- override = Configuration[override].stringify_keys
99
+ config = Configuration.new
101
100
  unless override.delete('skip_config_files')
102
101
  config = config.read_config_files(config.config_files(override))
103
102
  end
104
103
 
105
104
  # Merge DEFAULTS < _config.yml < override
106
- config = Utils.deep_merge_hashes(config, override).stringify_keys
105
+ config = Configuration.from Utils.deep_merge_hashes(config, override).stringify_keys
107
106
  set_timezone(config['timezone']) if config['timezone']
108
107
 
109
108
  config
@@ -80,7 +80,24 @@ module Jekyll
80
80
  'coderay_css' => 'style'
81
81
  }
82
82
  }
83
- }]
83
+ }].freeze
84
+
85
+ class << self
86
+ # Static: Produce a Configuration ready for use in a Site.
87
+ # It takes the input, fills in the defaults where values do not
88
+ # exist, and patches common issues including migrating options for
89
+ # backwards compatiblity. Except where a key or value is being fixed,
90
+ # the user configuration will override the defaults.
91
+ #
92
+ # user_config - a Hash or Configuration of overrides.
93
+ #
94
+ # Returns a Configuration filled with defaults and fixed for common
95
+ # problems and backwards-compatibility.
96
+ def from(user_config)
97
+ Utils.deep_merge_hashes(DEFAULTS, Configuration[user_config].stringify_keys).
98
+ fix_common_issues.backwards_compatibilize.add_default_collections
99
+ end
100
+ end
84
101
 
85
102
  # Public: Turn all keys into string
86
103
  #
@@ -177,6 +194,7 @@ module Jekyll
177
194
 
178
195
  begin
179
196
  files.each do |config_file|
197
+ next if config_file.nil? or config_file.empty?
180
198
  new_config = read_config_file(config_file)
181
199
  configuration = Utils.deep_merge_hashes(configuration, new_config)
182
200
  end
@@ -243,7 +261,7 @@ module Jekyll
243
261
  " as a list of comma-separated values."
244
262
  config[option] = csv_to_array(config[option])
245
263
  end
246
- config[option].map!(&:to_s)
264
+ config[option].map!(&:to_s) if config[option]
247
265
  end
248
266
 
249
267
  if (config['kramdown'] || {}).key?('use_coderay')
@@ -278,14 +296,22 @@ module Jekyll
278
296
  def add_default_collections
279
297
  config = clone
280
298
 
299
+ # It defaults to `{}`, so this is only if someone sets it to null manually.
281
300
  return config if config['collections'].nil?
282
301
 
302
+ # Ensure we have a hash.
283
303
  if config['collections'].is_a?(Array)
284
304
  config['collections'] = Hash[config['collections'].map{|c| [c, {}]}]
285
305
  end
286
- config['collections']['posts'] ||= {}
287
- config['collections']['posts']['output'] = true
288
- config['collections']['posts']['permalink'] = style_to_permalink(config['permalink'])
306
+
307
+ config['collections'] = Utils.deep_merge_hashes(
308
+ { 'posts' => {} }, config['collections']
309
+ ).tap do |collections|
310
+ collections['posts']['output'] = true
311
+ if config['permalink']
312
+ collections['posts']['permalink'] ||= style_to_permalink(config['permalink'])
313
+ end
314
+ end
289
315
 
290
316
  config
291
317
  end
@@ -289,7 +289,7 @@ module Jekyll
289
289
  @data = SafeYAML.load_file(path)
290
290
  else
291
291
  begin
292
- defaults = @site.frontmatter_defaults.all(url, collection.label.to_sym)
292
+ defaults = @site.frontmatter_defaults.all(relative_path, collection.label.to_sym)
293
293
  merge_data!(defaults, source: "front matter defaults") unless defaults.empty?
294
294
 
295
295
  self.content = File.read(path, merged_file_read_opts(opts))
@@ -273,7 +273,7 @@ module Jekyll
273
273
  "html_pages" => pages.select { |page| page.html? || page.url.end_with?("/") },
274
274
  "categories" => post_attr_hash('categories'),
275
275
  "tags" => post_attr_hash('tags'),
276
- "collections" => collections.values.map(&:to_liquid),
276
+ "collections" => collections.values.sort_by(&:label).map(&:to_liquid),
277
277
  "documents" => documents,
278
278
  "data" => site_data
279
279
  }))
@@ -1,3 +1,3 @@
1
1
  module Jekyll
2
- VERSION = '3.0.3'
2
+ VERSION = '3.0.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-08 00:00:00.000000000 Z
11
+ date: 2016-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: liquid