jekyll 4.1.0 → 4.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8de141f536d43289d9c0f6dcea9282eca345760cb15208d11971128f0e9c9b23
4
- data.tar.gz: d3f2ed7b92cc8a96b1c56c183912247d60399fb13bf899b874093797d1b8c574
3
+ metadata.gz: b74631944252558b9ad068a1df651f0890577d11c6ac24d06050fe76e9a41d60
4
+ data.tar.gz: c34826fe92efe4fe968692fa3517c4f8ddf600b9c99af1776d305804e313a1fe
5
5
  SHA512:
6
- metadata.gz: 188a24d699ba093c3a55048cacb969158cb027a4df37cdc62bd31c22dd8223c8c8b138a190b5eaee85fb811be771fa3e8256bde4b1c8f6fdfbac8a69dbc221c4
7
- data.tar.gz: d2eb7caccefdaebfeec3cce77f749d4ade2d463eb39d85ab9f3fe9a54afadc193fcfc7218692124e217843443f0ae9b0a3ee71a9ffb6ececc245fc063c370f1e
6
+ metadata.gz: d89ea1ca35864a53aa21d21847ef357d33a28f8e094bc4c39bc519c2895ea6e8a87d86669252af4b9431a23634209bf38e909ea7b0686ba22bcac898a43488cc
7
+ data.tar.gz: 950488593a4b255d8196baf07dfdd04a85bd062cf7b612531b6253eb4118d77ab8209290f535621dd2dc6aec2a73f8079092d243aaa002411e855b6264a5c33a
@@ -56,6 +56,8 @@ Lint/NestedPercentLiteral:
56
56
  - test/test_site.rb
57
57
  Lint/DeprecatedOpenSSLConstant:
58
58
  Enabled: true
59
+ Lint/MixedRegexpCaptureTypes:
60
+ Enabled: false
59
61
  Lint/RaiseException:
60
62
  Enabled: true
61
63
  Lint/StructNewOverride:
@@ -86,6 +88,7 @@ Metrics/CyclomaticComplexity:
86
88
  Exclude:
87
89
  - lib/jekyll/utils.rb
88
90
  - lib/jekyll/commands/serve.rb
91
+ Max: 11
89
92
  Metrics/MethodLength:
90
93
  CountComments: false
91
94
  Max: 20
@@ -169,6 +172,12 @@ Style/PercentLiteralDelimiters:
169
172
  "%w": "()"
170
173
  "%W": "()"
171
174
  "%x": "()"
175
+ Style/RedundantFetchBlock:
176
+ Enabled: false
177
+ Style/RedundantRegexpCharacterClass:
178
+ Enabled: true
179
+ Style/RedundantRegexpEscape:
180
+ Enabled: true
172
181
  Style/RegexpLiteral:
173
182
  EnforcedStyle: percent_r
174
183
  Style/RescueModifier:
@@ -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)
@@ -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.
@@ -28,7 +28,6 @@ module Jekyll
28
28
  )
29
29
  end
30
30
 
31
- # rubocop:disable Metrics/CyclomaticComplexity
32
31
  def filter(entries)
33
32
  entries.reject do |e|
34
33
  # Reject this entry if it is just a "dot" representation.
@@ -51,7 +50,6 @@ module Jekyll
51
50
  special?(e) || backup?(e)
52
51
  end
53
52
  end
54
- # rubocop:enable Metrics/CyclomaticComplexity
55
53
 
56
54
  def included?(entry)
57
55
  glob_include?(site.include, entry) ||
@@ -399,7 +399,6 @@ module Jekyll
399
399
 
400
400
  # `where` filter helper
401
401
  #
402
- # rubocop:disable Metrics/CyclomaticComplexity
403
402
  # rubocop:disable Metrics/PerceivedComplexity
404
403
  def compare_property_vs_target(property, target)
405
404
  case target
@@ -421,7 +420,7 @@ module Jekyll
421
420
 
422
421
  false
423
422
  end
424
- # rubocop:enable Metrics/CyclomaticComplexity
423
+
425
424
  # rubocop:enable Metrics/PerceivedComplexity
426
425
 
427
426
  def item_property(item, property)
@@ -49,6 +49,7 @@ module Jekyll
49
49
 
50
50
  process(name)
51
51
  read_yaml(PathManager.join(base, dir), name)
52
+ generate_excerpt if site.config["page_excerpts"]
52
53
 
53
54
  data.default_proc = proc do |_, key|
54
55
  site.frontmatter_defaults.find(relative_path, type, key)
@@ -71,38 +72,6 @@ module Jekyll
71
72
  end
72
73
  end
73
74
 
74
- # For backwards-compatibility in subclasses that do not redefine
75
- # the `:to_liquid` method, stash existing definition under a new name
76
- #
77
- # TODO: Remove in Jekyll 5.0
78
- alias_method :legacy_to_liquid, :to_liquid
79
- private :legacy_to_liquid
80
-
81
- # Private
82
- # Subclasses can choose to optimize their `:to_liquid` method by wrapping
83
- # it around this definition.
84
- #
85
- # TODO: Remove in Jekyll 5.0
86
- def liquid_drop
87
- @liquid_drop ||= begin
88
- defaults = site.frontmatter_defaults.all(relative_path, type)
89
- unless defaults.empty?
90
- Utils.deep_merge_hashes!(data, Utils.deep_merge_hashes!(defaults, data))
91
- end
92
- Drops::PageDrop.new(self)
93
- end
94
- end
95
- private :liquid_drop
96
-
97
- # Public
98
- #
99
- # Liquid representation of current page
100
- #
101
- # TODO: Remove optional parameter in Jekyll 5.0
102
- def to_liquid(attrs = nil)
103
- self.class == Jekyll::Page ? liquid_drop : legacy_to_liquid(attrs)
104
- end
105
-
106
75
  # The full path and filename of the post. Defined in the YAML of the post
107
76
  # body.
108
77
  #
@@ -178,7 +147,7 @@ module Jekyll
178
147
 
179
148
  # The path to the page source file, relative to the site source
180
149
  def relative_path
181
- @relative_path ||= File.join(*[@dir, @name].map(&:to_s).reject(&:empty?)).sub(%r!\A\/!, "")
150
+ @relative_path ||= File.join(*[@dir, @name].map(&:to_s).reject(&:empty?)).sub(%r!\A/!, "")
182
151
  end
183
152
 
184
153
  # Obtain destination path.
@@ -221,9 +190,21 @@ module Jekyll
221
190
  end
222
191
 
223
192
  def excerpt
224
- return data["excerpt"] unless self.class == Jekyll::Page
193
+ return @excerpt if defined?(@excerpt)
194
+
195
+ @excerpt = data["excerpt"]&.to_s
196
+ end
197
+
198
+ def generate_excerpt?
199
+ !excerpt_separator.empty? && self.class == Jekyll::Page && html?
200
+ end
201
+
202
+ private
203
+
204
+ def generate_excerpt
205
+ return unless generate_excerpt?
225
206
 
226
- data["excerpt"] ||= Jekyll::PageExcerpt.new(self).to_liquid unless excerpt_separator.empty?
207
+ data["excerpt"] ||= Jekyll::PageExcerpt.new(self)
227
208
  end
228
209
  end
229
210
  end
@@ -2,15 +2,14 @@
2
2
 
3
3
  module Jekyll
4
4
  class PageExcerpt < Excerpt
5
- attr_reader :output, :doc
5
+ attr_reader :doc
6
6
  alias_method :id, :relative_path
7
7
 
8
- # The Liquid representation of this instance is simply the rendered output string.
9
- alias_method :to_liquid, :output
8
+ EXCERPT_ATTRIBUTES = (Page::ATTRIBUTES_FOR_LIQUID - %w(excerpt)).freeze
9
+ private_constant :EXCERPT_ATTRIBUTES
10
10
 
11
- def initialize(doc)
12
- super
13
- self.output = Renderer.new(site, self, site.site_payload).run
11
+ def to_liquid
12
+ @to_liquid ||= doc.to_liquid(EXCERPT_ATTRIBUTES)
14
13
  end
15
14
 
16
15
  def render_with_liquid?
@@ -5,15 +5,15 @@ module Jekyll
5
5
  class IncludeTag < Liquid::Tag
6
6
  VALID_SYNTAX = %r!
7
7
  ([\w-]+)\s*=\s*
8
- (?:"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'|([\w\.-]+))
8
+ (?:"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'|([\w.-]+))
9
9
  !x.freeze
10
10
  VARIABLE_SYNTAX = %r!
11
- (?<variable>[^{]*(\{\{\s*[\w\-\.]+\s*(\|.*)?\}\}[^\s{}]*)+)
11
+ (?<variable>[^{]*(\{\{\s*[\w\-.]+\s*(\|.*)?\}\}[^\s{}]*)+)
12
12
  (?<params>.*)
13
13
  !mx.freeze
14
14
 
15
15
  FULL_VALID_SYNTAX = %r!\A\s*(?:#{VALID_SYNTAX}(?=\s|\z)\s*)*\z!.freeze
16
- VALID_FILENAME_CHARS = %r!^[\w/\.-]+$!.freeze
16
+ VALID_FILENAME_CHARS = %r!^[\w/.-]+$!.freeze
17
17
  INVALID_SEQUENCES = %r![./]{2,}!.freeze
18
18
 
19
19
  def initialize(tag_name, markup, tokens)
@@ -215,7 +215,7 @@ module Jekyll
215
215
  slug = replace_character_sequence_with_hyphen(string, :mode => mode)
216
216
 
217
217
  # Remove leading/trailing hyphen
218
- slug.gsub!(%r!^\-|\-$!i, "")
218
+ slug.gsub!(%r!^-|-$!i, "")
219
219
 
220
220
  slug.downcase! unless cased
221
221
  Jekyll.logger.warn("Warning:", "Empty `slug` generated for '#{string}'.") if slug.empty?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Jekyll
4
- VERSION = "4.1.0"
4
+ VERSION = "4.1.1"
5
5
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
8
8
  - Parker Moore
9
9
  - Matt Rogers
10
- autorequire:
10
+ autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2020-05-27 00:00:00.000000000 Z
13
+ date: 2020-06-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: addressable
@@ -257,7 +257,6 @@ files:
257
257
  - lib/jekyll/drops/drop.rb
258
258
  - lib/jekyll/drops/excerpt_drop.rb
259
259
  - lib/jekyll/drops/jekyll_drop.rb
260
- - lib/jekyll/drops/page_drop.rb
261
260
  - lib/jekyll/drops/site_drop.rb
262
261
  - lib/jekyll/drops/static_file_drop.rb
263
262
  - lib/jekyll/drops/unified_payload_drop.rb
@@ -349,7 +348,7 @@ metadata:
349
348
  bug_tracker_uri: https://github.com/jekyll/jekyll/issues
350
349
  changelog_uri: https://github.com/jekyll/jekyll/releases
351
350
  homepage_uri: https://jekyllrb.com
352
- post_install_message:
351
+ post_install_message:
353
352
  rdoc_options:
354
353
  - "--charset=UTF-8"
355
354
  require_paths:
@@ -366,7 +365,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
366
365
  version: 2.7.0
367
366
  requirements: []
368
367
  rubygems_version: 3.1.2
369
- signing_key:
368
+ signing_key:
370
369
  specification_version: 4
371
370
  summary: A simple, blog aware, static site generator.
372
371
  test_files: []
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Jekyll
4
- module Drops
5
- class PageDrop < Drop
6
- extend Forwardable
7
-
8
- mutable false
9
-
10
- def_delegators :@obj, :content, :dir, :name, :path, :url, :excerpt
11
- private def_delegator :@obj, :data, :fallback_data
12
-
13
- def title
14
- @obj.data["title"]
15
- end
16
- end
17
- end
18
- end