jekyll 4.0.0.pre.beta1 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +204 -18
  3. data/README.markdown +2 -6
  4. data/lib/blank_template/_layouts/default.html +1 -1
  5. data/lib/jekyll.rb +6 -17
  6. data/lib/jekyll/cleaner.rb +3 -3
  7. data/lib/jekyll/collection.rb +2 -2
  8. data/lib/jekyll/command.rb +4 -2
  9. data/lib/jekyll/commands/doctor.rb +19 -15
  10. data/lib/jekyll/commands/new.rb +4 -4
  11. data/lib/jekyll/commands/new_theme.rb +0 -2
  12. data/lib/jekyll/commands/serve.rb +12 -1
  13. data/lib/jekyll/configuration.rb +18 -19
  14. data/lib/jekyll/converters/identity.rb +2 -2
  15. data/lib/jekyll/converters/markdown/kramdown_parser.rb +70 -1
  16. data/lib/jekyll/convertible.rb +30 -23
  17. data/lib/jekyll/document.rb +41 -19
  18. data/lib/jekyll/drops/collection_drop.rb +3 -3
  19. data/lib/jekyll/drops/document_drop.rb +4 -3
  20. data/lib/jekyll/drops/drop.rb +98 -20
  21. data/lib/jekyll/drops/site_drop.rb +3 -3
  22. data/lib/jekyll/drops/static_file_drop.rb +4 -4
  23. data/lib/jekyll/drops/url_drop.rb +11 -3
  24. data/lib/jekyll/entry_filter.rb +18 -7
  25. data/lib/jekyll/excerpt.rb +1 -1
  26. data/lib/jekyll/filters.rb +112 -28
  27. data/lib/jekyll/filters/url_filters.rb +45 -15
  28. data/lib/jekyll/frontmatter_defaults.rb +14 -19
  29. data/lib/jekyll/hooks.rb +22 -21
  30. data/lib/jekyll/inclusion.rb +32 -0
  31. data/lib/jekyll/layout.rb +5 -0
  32. data/lib/jekyll/liquid_renderer.rb +18 -15
  33. data/lib/jekyll/liquid_renderer/file.rb +10 -0
  34. data/lib/jekyll/liquid_renderer/table.rb +1 -64
  35. data/lib/jekyll/page.rb +42 -11
  36. data/lib/jekyll/page_excerpt.rb +25 -0
  37. data/lib/jekyll/path_manager.rb +53 -10
  38. data/lib/jekyll/profiler.rb +58 -0
  39. data/lib/jekyll/reader.rb +11 -6
  40. data/lib/jekyll/readers/collection_reader.rb +1 -0
  41. data/lib/jekyll/readers/data_reader.rb +4 -0
  42. data/lib/jekyll/readers/layout_reader.rb +1 -0
  43. data/lib/jekyll/readers/page_reader.rb +1 -0
  44. data/lib/jekyll/readers/post_reader.rb +2 -1
  45. data/lib/jekyll/readers/static_file_reader.rb +1 -0
  46. data/lib/jekyll/readers/theme_assets_reader.rb +1 -0
  47. data/lib/jekyll/related_posts.rb +1 -1
  48. data/lib/jekyll/renderer.rb +15 -17
  49. data/lib/jekyll/site.rb +34 -10
  50. data/lib/jekyll/static_file.rb +17 -12
  51. data/lib/jekyll/tags/include.rb +82 -33
  52. data/lib/jekyll/tags/link.rb +2 -1
  53. data/lib/jekyll/tags/post_url.rb +3 -4
  54. data/lib/jekyll/theme.rb +6 -8
  55. data/lib/jekyll/url.rb +8 -5
  56. data/lib/jekyll/utils.rb +5 -5
  57. data/lib/jekyll/utils/platforms.rb +34 -49
  58. data/lib/jekyll/utils/win_tz.rb +1 -1
  59. data/lib/jekyll/version.rb +1 -1
  60. data/lib/theme_template/theme.gemspec.erb +1 -4
  61. metadata +34 -39
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 557bf944b97df515f8ac16b41b21317a4361fa27e45c44d63ea8579e14a8188e
4
- data.tar.gz: 436685ee32413cf98111372ca82f1f39d38f549cc2cf482c86a1aba53e627b93
3
+ metadata.gz: 8ada984c6843d26b182a1b999fa99cba4f98af9aa15c4193d65116fa897e16da
4
+ data.tar.gz: '009c07098270b070724e1e17a9f02197b5ff8d4a9664ac26d1f6c835824f1627'
5
5
  SHA512:
6
- metadata.gz: 76c7cfa113e1a0741584a34be45ed4380e57250d1829d905d4aa1bba33ec06d6e1debf02a474ab36aca8f65ff1f4fca9cb97ce06c52e74715327267bb2bb5345
7
- data.tar.gz: 4f25d89074b8aae2dfdcad4a56246b7541137e5a226040898e13b0f610acce79e8d8aaee0c63ea7aae185d09156b85643269440d6a02bc59dac8e2d26033e4af
6
+ metadata.gz: 1b02fd6e6d2bcfcafd407528257ae71a17232bc8238d1174624c0967f2d1c60b30904bb0e2ee4b6f2e8297a19999c51833bfd6104b1d11f5bf435c64a598b573
7
+ data.tar.gz: 893e7d2991544d816fc4873b6906d55d6a0dc64d3274fac9b689025e1c50ce86776308d8e51b3713b826bccb50aad094e250f8b69259c141492a43a8b97881c8
@@ -1,4 +1,5 @@
1
1
  ---
2
+ inherit_from: .rubocop_todo.yml
2
3
 
3
4
  require:
4
5
  - rubocop-performance
@@ -20,32 +21,115 @@ AllCops:
20
21
  - script/**/*
21
22
  - vendor/**/*
22
23
  - tmp/**/*
23
- Layout/AlignHash:
24
+
25
+ Layout/BeginEndAlignment:
26
+ Enabled: true
27
+ Layout/EmptyComment:
28
+ Enabled: false
29
+ Layout/EmptyLinesAroundAttributeAccessor:
30
+ Enabled: true
31
+ Layout/EndAlignment:
32
+ Severity: error
33
+ Layout/HashAlignment:
24
34
  EnforcedHashRocketStyle: table
25
35
  Layout/IndentationWidth:
26
36
  Severity: error
27
- Layout/IndentFirstArrayElement:
37
+ Layout/FirstArrayElementIndentation:
28
38
  EnforcedStyle: consistent
29
- Layout/IndentFirstHashElement:
39
+ Layout/FirstHashElementIndentation:
30
40
  EnforcedStyle: consistent
41
+ Layout/LineLength:
42
+ Exclude:
43
+ - !ruby/regexp /features\/.*.rb/
44
+ - Rakefile
45
+ - rake/*.rake
46
+ - Gemfile
47
+ Max: 100
48
+ Severity: warning
31
49
  Layout/MultilineMethodCallIndentation:
32
50
  EnforcedStyle: indented
33
51
  Layout/MultilineOperationIndentation:
34
52
  EnforcedStyle: indented
53
+ Layout/SpaceAroundMethodCallOperator:
54
+ Enabled: true
55
+ Layout/SpaceInsideHashLiteralBraces:
56
+ Enabled: true
57
+ Exclude:
58
+ - test/**/*.rb
59
+
60
+ Lint/BinaryOperatorWithIdenticalOperands:
61
+ Enabled: true
62
+ Lint/ConstantDefinitionInBlock:
63
+ Enabled: true
64
+ Exclude:
65
+ - test/**/*.rb
66
+ Lint/DeprecatedOpenSSLConstant:
67
+ Enabled: true
68
+ Lint/DuplicateBranch:
69
+ Enabled: true
70
+ Lint/DuplicateElsifCondition:
71
+ Enabled: true
72
+ Lint/DuplicateRegexpCharacterClassElement:
73
+ Enabled: true
74
+ Lint/DuplicateRescueException:
75
+ Enabled: true
76
+ Lint/DuplicateRequire:
77
+ Enabled: true
78
+ Lint/EmptyBlock:
79
+ Enabled: true
80
+ Lint/EmptyClass:
81
+ Enabled: true
82
+ Lint/EmptyConditionalBody:
83
+ Enabled: true
84
+ Lint/EmptyFile:
85
+ Enabled: true
86
+ Lint/FloatComparison:
87
+ Enabled: true
88
+ Lint/HashCompareByIdentity:
89
+ Enabled: true
90
+ Lint/IdentityComparison:
91
+ Enabled: true
92
+ Lint/MissingSuper:
93
+ Enabled: false
94
+ Lint/MixedRegexpCaptureTypes:
95
+ Enabled: false
35
96
  Lint/NestedPercentLiteral:
36
97
  Exclude:
37
98
  - test/test_site.rb
38
- Layout/EmptyComment:
99
+ Lint/NoReturnInBeginEndBlocks:
100
+ Enabled: true
101
+ Lint/OutOfRangeRegexpRef:
102
+ Enabled: true
103
+ Lint/RaiseException:
104
+ Enabled: true
105
+ Lint/RedundantSafeNavigation:
106
+ Enabled: true
107
+ Lint/SelfAssignment:
108
+ Enabled: true
109
+ Lint/StructNewOverride:
110
+ Enabled: true
111
+ Lint/ToEnumArguments:
39
112
  Enabled: false
40
- Layout/EndAlignment:
41
- Severity: error
113
+ Lint/TopLevelReturnWithArgument:
114
+ Enabled: true
115
+ Lint/TrailingCommaInAttributeDeclaration:
116
+ Enabled: true
117
+ Lint/UnmodifiedReduceAccumulator:
118
+ Enabled: true
42
119
  Lint/UnreachableCode:
43
120
  Severity: error
121
+ Lint/UnreachableLoop:
122
+ Enabled: true
123
+ Lint/UselessMethodDefinition:
124
+ Enabled: true
125
+ Lint/UselessTimes:
126
+ Enabled: true
44
127
  Lint/Void:
45
128
  Exclude:
46
129
  - lib/jekyll/site.rb
130
+
47
131
  Metrics/AbcSize:
48
- Max: 21
132
+ Max: 23
49
133
  Metrics/BlockLength:
50
134
  Exclude:
51
135
  - test/**/*.rb
@@ -64,24 +148,20 @@ Metrics/CyclomaticComplexity:
64
148
  Exclude:
65
149
  - lib/jekyll/utils.rb
66
150
  - lib/jekyll/commands/serve.rb
67
- Metrics/LineLength:
68
- Exclude:
69
- - !ruby/regexp /features\/.*.rb/
70
- - Rakefile
71
- - rake/*.rake
72
- - Gemfile
73
- Max: 100
74
- Severity: warning
151
+ Max: 11
75
152
  Metrics/MethodLength:
76
153
  CountComments: false
77
154
  Max: 20
78
155
  Severity: error
79
156
  Metrics/ModuleLength:
80
157
  Max: 240
158
+ Exclude:
159
+ - lib/jekyll/filters.rb
81
160
  Metrics/ParameterLists:
82
161
  Max: 4
83
162
  Metrics/PerceivedComplexity:
84
- Max: 8
163
+ Max: 13
164
+
85
165
  Naming/FileName:
86
166
  Enabled: false
87
167
  Naming/HeredocDelimiterNaming:
@@ -93,6 +173,40 @@ Naming/MemoizedInstanceVariableName:
93
173
  - lib/jekyll/drops/site_drop.rb
94
174
  - lib/jekyll/drops/unified_payload_drop.rb
95
175
  - lib/jekyll/page_without_a_file.rb
176
+
177
+ Performance/AncestorsInclude:
178
+ Enabled: false
179
+ Performance/ArraySemiInfiniteRangeSlice:
180
+ Enabled: true
181
+ Performance/BigDecimalWithNumericArgument:
182
+ Enabled: true
183
+ Performance/BlockGivenWithExplicitBlock:
184
+ Enabled: true
185
+ Performance/ChainArrayAllocation:
186
+ Enabled: true
187
+ Performance/CollectionLiteralInLoop:
188
+ Enabled: true
189
+ Performance/ConstantRegexp:
190
+ Enabled: true
191
+ Performance/MethodObjectAsBlock:
192
+ Enabled: true
193
+ Performance/RedundantSortBlock:
194
+ Enabled: true
195
+ Performance/RedundantStringChars:
196
+ Enabled: true
197
+ Performance/ReverseFirst:
198
+ Enabled: true
199
+ Performance/SortReverse:
200
+ Enabled: false
201
+ Performance/Squeeze:
202
+ Enabled: true
203
+ Performance/StringInclude:
204
+ Enabled: true
205
+ Exclude:
206
+ - lib/jekyll/utils/platforms.rb
207
+ Performance/Sum:
208
+ Enabled: true
209
+
96
210
  Security/MarshalLoad:
97
211
  Exclude:
98
212
  - !ruby/regexp /test\/.*.rb$/
@@ -101,29 +215,68 @@ Security/YAMLLoad:
101
215
  Exclude:
102
216
  - !ruby/regexp /features\/.*.rb/
103
217
  - !ruby/regexp /test\/.*.rb$/
218
+
219
+ Style/ArgumentsForwarding:
220
+ Enabled: false
221
+ Style/ArrayCoercion:
222
+ Enabled: true
104
223
  Style/AccessModifierDeclarations:
105
224
  Enabled: false
225
+ Style/AccessorGrouping:
226
+ Enabled: false
106
227
  Style/Alias:
107
228
  EnforcedStyle: prefer_alias_method
108
229
  Style/AndOr:
109
230
  Severity: error
231
+ Style/BisectedAttrAccessor:
232
+ Enabled: true
233
+ Style/CaseLikeIf:
234
+ Enabled: true
110
235
  Style/ClassAndModuleChildren:
111
236
  Exclude:
112
237
  - test/**/*.rb
113
- Style/FrozenStringLiteralComment:
114
- EnforcedStyle: always
238
+ Style/ClassEqualityComparison:
239
+ Enabled: true
240
+ Style/CollectionCompact:
241
+ Enabled: true
242
+ Style/CombinableLoops:
243
+ Enabled: true
115
244
  Style/Documentation:
116
245
  Enabled: false
246
+ Style/DocumentDynamicEvalDefinition:
247
+ Enabled: true
117
248
  Style/DoubleNegation:
118
249
  Enabled: false
250
+ Style/ExponentialNotation:
251
+ Enabled: true
252
+ Style/ExplicitBlockArgument:
253
+ Enabled: false
119
254
  Style/FormatStringToken:
120
255
  Exclude:
121
256
  - lib/jekyll/utils/ansi.rb
257
+ - lib/jekyll/liquid_renderer/table.rb
258
+ - lib/jekyll/profiler.rb
259
+ Style/FrozenStringLiteralComment:
260
+ EnforcedStyle: always
261
+ Style/GlobalStdStream:
262
+ Enabled: true
122
263
  Style/GuardClause:
123
264
  Enabled: false
265
+ Style/HashAsLastArrayItem:
266
+ Enabled: true
267
+ Style/HashEachMethods:
268
+ Enabled: true
269
+ Style/HashLikeCase:
270
+ Enabled: true
124
271
  Style/HashSyntax:
125
272
  EnforcedStyle: hash_rockets
126
273
  Severity: error
274
+ Style/HashTransformKeys:
275
+ Enabled: false
276
+ Style/HashTransformValues:
277
+ Enabled: true
278
+ Style/KeywordParametersOrder:
279
+ Enabled: true
127
280
  Style/MixinUsage:
128
281
  Exclude:
129
282
  - test/helper.rb
@@ -131,6 +284,12 @@ Style/ModuleFunction:
131
284
  Enabled: false
132
285
  Style/MultilineTernaryOperator:
133
286
  Severity: error
287
+ Style/NegatedIfElseCondition:
288
+ Enabled: true
289
+ Style/NilLambda:
290
+ Enabled: true
291
+ Style/OptionalBooleanParameter:
292
+ Enabled: true
134
293
  Style/PercentLiteralDelimiters:
135
294
  PreferredDelimiters:
136
295
  "%q": "{}"
@@ -140,6 +299,20 @@ Style/PercentLiteralDelimiters:
140
299
  "%w": "()"
141
300
  "%W": "()"
142
301
  "%x": "()"
302
+ Style/RedundantArgument:
303
+ Enabled: true
304
+ Style/RedundantAssignment:
305
+ Enabled: true
306
+ Style/RedundantFetchBlock:
307
+ Enabled: false
308
+ Style/RedundantFileExtensionInRequire:
309
+ Enabled: true
310
+ Style/RedundantRegexpCharacterClass:
311
+ Enabled: true
312
+ Style/RedundantRegexpEscape:
313
+ Enabled: true
314
+ Style/RedundantSelfAssignment:
315
+ Enabled: true
143
316
  Style/RegexpLiteral:
144
317
  EnforcedStyle: percent_r
145
318
  Style/RescueModifier:
@@ -149,10 +322,23 @@ Style/SafeNavigation:
149
322
  - lib/jekyll/document.rb
150
323
  Style/SignalException:
151
324
  EnforcedStyle: only_raise
325
+ Style/SingleArgumentDig:
326
+ Enabled: true
327
+ Style/SlicingWithRange:
328
+ Enabled: false
329
+ Style/SoleNestedConditional:
330
+ Enabled: true
152
331
  Style/StringLiterals:
153
332
  EnforcedStyle: double_quotes
333
+ Style/StringConcatenation:
334
+ Enabled: true
335
+ Exclude:
336
+ - lib/jekyll/commands/*.rb
337
+ - test/**/*.rb
154
338
  Style/StringLiteralsInInterpolation:
155
339
  EnforcedStyle: double_quotes
340
+ Style/SwapValues:
341
+ Enabled: true
156
342
  Style/SymbolArray:
157
343
  EnforcedStyle: brackets
158
344
  Style/TrailingCommaInArrayLiteral:
@@ -1,19 +1,15 @@
1
1
  # [Jekyll](https://jekyllrb.com/)
2
2
 
3
3
  [![Gem Version](https://img.shields.io/gem/v/jekyll.svg)][ruby-gems]
4
- [![Linux Build Status](https://img.shields.io/travis/jekyll/jekyll/master.svg?label=Linux%20build)][travis]
4
+ [![Linux Build Status](https://github.com/jekyll/jekyll/workflows/Continuous%20Integration/badge.svg)][ci-workflow]
5
5
  [![Windows Build status](https://img.shields.io/appveyor/ci/jekyll/jekyll/master.svg?label=Windows%20build)][appveyor]
6
- [![Maintainability](https://api.codeclimate.com/v1/badges/8ba0cb5b17bb9848e128/maintainability)][codeclimate]
7
- [![Test Coverage](https://api.codeclimate.com/v1/badges/8ba0cb5b17bb9848e128/test_coverage)][coverage]
8
6
  [![Security](https://hakiri.io/github/jekyll/jekyll/master.svg)][hakiri]
9
7
  [![Backers on Open Collective](https://opencollective.com/jekyll/backers/badge.svg)](#backers)
10
8
  [![Sponsors on Open Collective](https://opencollective.com/jekyll/sponsors/badge.svg)](#sponsors)
11
9
 
12
10
  [ruby-gems]: https://rubygems.org/gems/jekyll
13
- [codeclimate]: https://codeclimate.com/github/jekyll/jekyll
14
- [coverage]: https://codeclimate.com/github/jekyll/jekyll/coverage
15
11
  [hakiri]: https://hakiri.io/github/jekyll/jekyll/master
16
- [travis]: https://travis-ci.org/jekyll/jekyll
12
+ [ci-workflow]: https://github.com/jekyll/jekyll/actions?query=workflow%3A%22Continuous+Integration%22+branch%3Amaster
17
13
  [appveyor]: https://ci.appveyor.com/project/jekyll/jekyll/branch/master
18
14
 
19
15
  Jekyll is a simple, blog-aware, static site generator perfect for personal, project, or organization sites. Think of it like a file-based CMS, without all the complexity. Jekyll takes your content, renders Markdown and Liquid templates, and spits out a complete, static website ready to be served by Apache, Nginx or another web server. Jekyll is the engine behind [GitHub Pages](https://pages.github.com), which you can use to host sites right from your GitHub repositories.
@@ -7,6 +7,6 @@
7
7
  <link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}">
8
8
  </head>
9
9
  <body>
10
- {{ content}}
10
+ {{ content }}
11
11
  </body>
12
12
  </html>
@@ -50,10 +50,12 @@ module Jekyll
50
50
  autoload :EntryFilter, "jekyll/entry_filter"
51
51
  autoload :Errors, "jekyll/errors"
52
52
  autoload :Excerpt, "jekyll/excerpt"
53
+ autoload :PageExcerpt, "jekyll/page_excerpt"
53
54
  autoload :External, "jekyll/external"
54
55
  autoload :FrontmatterDefaults, "jekyll/frontmatter_defaults"
55
56
  autoload :Hooks, "jekyll/hooks"
56
57
  autoload :Layout, "jekyll/layout"
58
+ autoload :Inclusion, "jekyll/inclusion"
57
59
  autoload :Cache, "jekyll/cache"
58
60
  autoload :CollectionReader, "jekyll/readers/collection_reader"
59
61
  autoload :DataReader, "jekyll/readers/data_reader"
@@ -68,6 +70,7 @@ module Jekyll
68
70
  autoload :PathManager, "jekyll/path_manager"
69
71
  autoload :PluginManager, "jekyll/plugin_manager"
70
72
  autoload :Publisher, "jekyll/publisher"
73
+ autoload :Profiler, "jekyll/profiler"
71
74
  autoload :Reader, "jekyll/reader"
72
75
  autoload :Regenerator, "jekyll/regenerator"
73
76
  autoload :RelatedPosts, "jekyll/related_posts"
@@ -170,27 +173,13 @@ module Jekyll
170
173
  # Returns the sanitized path.
171
174
  def sanitized_path(base_directory, questionable_path)
172
175
  return base_directory if base_directory.eql?(questionable_path)
176
+ return base_directory if questionable_path.nil?
173
177
 
174
- clean_path = questionable_path.dup
175
- clean_path.insert(0, "/") if clean_path.start_with?("~")
176
- clean_path = File.expand_path(clean_path, "/")
177
-
178
- return clean_path if clean_path.eql?(base_directory)
179
-
180
- # remove any remaining extra leading slashes not stripped away by calling
181
- # `File.expand_path` above.
182
- clean_path.squeeze!("/")
183
-
184
- if clean_path.start_with?(base_directory.sub(%r!\z!, "/"))
185
- clean_path
186
- else
187
- clean_path.sub!(%r!\A\w:/!, "/")
188
- File.join(base_directory, clean_path)
189
- end
178
+ +Jekyll::PathManager.sanitized_path(base_directory, questionable_path)
190
179
  end
191
180
 
192
181
  # Conditional optimizations
193
- Jekyll::External.require_if_present("liquid-c")
182
+ Jekyll::External.require_if_present("liquid/c")
194
183
  end
195
184
  end
196
185
 
@@ -3,7 +3,7 @@
3
3
  module Jekyll
4
4
  # Handles the cleanup of a site's destination before it is built.
5
5
  class Cleaner
6
- HIDDEN_FILE_REGEX = %r!\/\.{1,2}$!.freeze
6
+ HIDDEN_FILE_REGEX = %r!/\.{1,2}$!.freeze
7
7
  attr_reader :site
8
8
 
9
9
  def initialize(site)
@@ -44,7 +44,7 @@ module Jekyll
44
44
  dirs = keep_dirs
45
45
 
46
46
  Utils.safe_glob(site.in_dest_dir, ["**", "*"], File::FNM_DOTMATCH).each do |file|
47
- next if file =~ HIDDEN_FILE_REGEX || file =~ regex || dirs.include?(file)
47
+ next if HIDDEN_FILE_REGEX.match?(file) || regex.match?(file) || dirs.include?(file)
48
48
 
49
49
  files << file
50
50
  end
@@ -105,7 +105,7 @@ module Jekyll
105
105
  #
106
106
  # Returns the regular expression
107
107
  def keep_file_regex
108
- %r!\A#{Regexp.quote(site.dest)}\/(#{Regexp.union(site.keep_files).source})!
108
+ %r!\A#{Regexp.quote(site.dest)}/(#{Regexp.union(site.keep_files).source})!
109
109
  end
110
110
  end
111
111
  end
@@ -166,7 +166,7 @@ module Jekyll
166
166
  #
167
167
  # Returns a sanitized version of the label.
168
168
  def sanitize_label(label)
169
- label.gsub(%r![^a-z0-9_\-\.]!i, "")
169
+ label.gsub(%r![^a-z0-9_\-.]!i, "")
170
170
  end
171
171
 
172
172
  # Produce a representation of this Collection for use in Liquid.
@@ -239,7 +239,7 @@ module Jekyll
239
239
 
240
240
  # Fall back to `Document#<=>` if the properties were equal or were non-sortable
241
241
  # Otherwise continue with current sort-order
242
- if order.zero? || order.nil?
242
+ if order.nil? || order.zero?
243
243
  apples[-1] <=> olives[-1]
244
244
  else
245
245
  order