jekyll 4.2.2 → 4.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +150 -26
- data/README.markdown +16 -19
- data/lib/jekyll/cache.rb +3 -7
- data/lib/jekyll/cleaner.rb +1 -1
- data/lib/jekyll/collection.rb +1 -0
- data/lib/jekyll/commands/build.rb +2 -13
- data/lib/jekyll/commands/clean.rb +1 -2
- data/lib/jekyll/commands/doctor.rb +13 -13
- data/lib/jekyll/commands/new.rb +5 -9
- data/lib/jekyll/commands/new_theme.rb +3 -4
- data/lib/jekyll/commands/serve/live_reload_reactor.rb +3 -6
- data/lib/jekyll/commands/serve/mime_types_charset.json +71 -0
- data/lib/jekyll/commands/serve/servlet.rb +13 -9
- data/lib/jekyll/commands/serve.rb +23 -18
- data/lib/jekyll/configuration.rb +2 -2
- data/lib/jekyll/converters/markdown/kramdown_parser.rb +13 -15
- data/lib/jekyll/data_entry.rb +83 -0
- data/lib/jekyll/data_hash.rb +61 -0
- data/lib/jekyll/deprecator.rb +1 -1
- data/lib/jekyll/document.rb +2 -3
- data/lib/jekyll/drops/document_drop.rb +1 -0
- data/lib/jekyll/drops/excerpt_drop.rb +4 -0
- data/lib/jekyll/drops/site_drop.rb +6 -1
- data/lib/jekyll/drops/theme_drop.rb +36 -0
- data/lib/jekyll/drops/unified_payload_drop.rb +6 -2
- data/lib/jekyll/entry_filter.rb +2 -6
- data/lib/jekyll/excerpt.rb +5 -6
- data/lib/jekyll/external.rb +17 -21
- data/lib/jekyll/filters.rb +11 -14
- data/lib/jekyll/frontmatter_defaults.rb +2 -4
- data/lib/jekyll/hooks.rb +2 -2
- data/lib/jekyll/layout.rb +8 -20
- data/lib/jekyll/mime.types +146 -73
- data/lib/jekyll/page.rb +2 -4
- data/lib/jekyll/path_manager.rb +7 -7
- data/lib/jekyll/plugin_manager.rb +12 -4
- data/lib/jekyll/profiler.rb +0 -3
- data/lib/jekyll/reader.rb +18 -1
- data/lib/jekyll/readers/data_reader.rb +51 -14
- data/lib/jekyll/renderer.rb +8 -10
- data/lib/jekyll/site.rb +52 -21
- data/lib/jekyll/static_file.rb +6 -9
- data/lib/jekyll/tags/highlight.rb +13 -9
- data/lib/jekyll/tags/include.rb +4 -4
- data/lib/jekyll/tags/post_url.rb +5 -5
- data/lib/jekyll/theme.rb +6 -2
- data/lib/jekyll/theme_builder.rb +1 -1
- data/lib/jekyll/url.rb +1 -1
- data/lib/jekyll/utils/ansi.rb +1 -1
- data/lib/jekyll/utils/win_tz.rb +18 -47
- data/lib/jekyll/utils.rb +18 -7
- data/lib/jekyll/version.rb +1 -1
- data/lib/jekyll.rb +3 -1
- data/lib/site_template/_config.yml +1 -1
- data/lib/theme_template/README.md.erb +1 -3
- metadata +61 -13
data/lib/jekyll/excerpt.rb
CHANGED
@@ -4,8 +4,7 @@ module Jekyll
|
|
4
4
|
class Excerpt
|
5
5
|
extend Forwardable
|
6
6
|
|
7
|
-
attr_accessor :doc
|
8
|
-
attr_accessor :content, :ext
|
7
|
+
attr_accessor :content, :doc, :ext
|
9
8
|
attr_writer :output
|
10
9
|
|
11
10
|
def_delegators :@doc,
|
@@ -139,7 +138,7 @@ module Jekyll
|
|
139
138
|
return head if tail.empty?
|
140
139
|
|
141
140
|
head = sanctify_liquid_tags(head) if head.include?("{%")
|
142
|
-
definitions =
|
141
|
+
definitions = extract_markdown_link_reference_definitions(head, tail)
|
143
142
|
return head if definitions.empty?
|
144
143
|
|
145
144
|
head << "\n\n" << definitions.join("\n")
|
@@ -165,7 +164,7 @@ module Jekyll
|
|
165
164
|
head
|
166
165
|
end
|
167
166
|
|
168
|
-
def
|
167
|
+
def extract_markdown_link_reference_definitions(head, tail)
|
169
168
|
[].tap do |definitions|
|
170
169
|
tail.scan(MKDWN_LINK_REF_REGEX).each do |segments|
|
171
170
|
definitions << segments.join if head.include?(segments[0])
|
@@ -191,8 +190,8 @@ module Jekyll
|
|
191
190
|
|
192
191
|
def print_build_warning
|
193
192
|
Jekyll.logger.warn "Warning:", "Excerpt modified in #{doc.relative_path}!"
|
194
|
-
Jekyll.logger.warn "", "Found a Liquid block containing the excerpt separator" \
|
195
|
-
|
193
|
+
Jekyll.logger.warn "", "Found a Liquid block containing the excerpt separator " \
|
194
|
+
"#{doc.excerpt_separator.inspect}."
|
196
195
|
Jekyll.logger.warn "", "The block has been modified with the appropriate closing tag."
|
197
196
|
Jekyll.logger.warn "", "Feel free to define a custom excerpt or excerpt_separator in the"
|
198
197
|
Jekyll.logger.warn "", "document's Front Matter if the generated excerpt is unsatisfactory."
|
data/lib/jekyll/external.rb
CHANGED
@@ -22,13 +22,11 @@ module Jekyll
|
|
22
22
|
#
|
23
23
|
def require_if_present(names)
|
24
24
|
Array(names).each do |name|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
false
|
31
|
-
end
|
25
|
+
require name
|
26
|
+
rescue LoadError
|
27
|
+
Jekyll.logger.debug "Couldn't load #{name}. Skipping."
|
28
|
+
yield(name, version_constraint(name)) if block_given?
|
29
|
+
false
|
32
30
|
end
|
33
31
|
end
|
34
32
|
|
@@ -55,23 +53,21 @@ module Jekyll
|
|
55
53
|
#
|
56
54
|
def require_with_graceful_fail(names)
|
57
55
|
Array(names).each do |name|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
In order to use Jekyll as currently configured, you'll need to install this gem.
|
56
|
+
Jekyll.logger.debug "Requiring:", name.to_s
|
57
|
+
require name
|
58
|
+
rescue LoadError => e
|
59
|
+
Jekyll.logger.error "Dependency Error:", <<~MSG
|
60
|
+
Yikes! It looks like you don't have #{name} or one of its dependencies installed.
|
61
|
+
In order to use Jekyll as currently configured, you'll need to install this gem.
|
65
62
|
|
66
|
-
|
67
|
-
|
63
|
+
If you've run Jekyll with `bundle exec`, ensure that you have included the #{name}
|
64
|
+
gem in your Gemfile as well.
|
68
65
|
|
69
|
-
|
66
|
+
The full error message from Ruby is: '#{e.message}'
|
70
67
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
end
|
68
|
+
If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
|
69
|
+
MSG
|
70
|
+
raise Jekyll::Errors::MissingDependencyException, name
|
75
71
|
end
|
76
72
|
end
|
77
73
|
end
|
data/lib/jekyll/filters.rb
CHANGED
@@ -193,12 +193,10 @@ module Jekyll
|
|
193
193
|
@where_filter_cache[input_id] ||= {}
|
194
194
|
@where_filter_cache[input_id][property] ||= {}
|
195
195
|
|
196
|
-
# stash or
|
197
|
-
@where_filter_cache[input_id][property][value] ||=
|
198
|
-
|
199
|
-
|
200
|
-
end.to_a
|
201
|
-
end
|
196
|
+
# stash or retrieve results to return
|
197
|
+
@where_filter_cache[input_id][property][value] ||= input.select do |object|
|
198
|
+
compare_property_vs_target(item_property(object, property), value)
|
199
|
+
end.to_a
|
202
200
|
end
|
203
201
|
|
204
202
|
# Filters an array of objects against an expression
|
@@ -246,14 +244,13 @@ module Jekyll
|
|
246
244
|
@find_filter_cache[input_id] ||= {}
|
247
245
|
@find_filter_cache[input_id][property] ||= {}
|
248
246
|
|
249
|
-
# stash or
|
247
|
+
# stash or retrieve results to return
|
250
248
|
# Since `enum.find` can return nil or false, we use a placeholder string "<__NO MATCH__>"
|
251
249
|
# to validate caching.
|
252
|
-
result = @find_filter_cache[input_id][property][value] ||=
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
end
|
250
|
+
result = @find_filter_cache[input_id][property][value] ||= input.find do |object|
|
251
|
+
compare_property_vs_target(item_property(object, property), value)
|
252
|
+
end || "<__NO MATCH__>"
|
253
|
+
|
257
254
|
return nil if result == "<__NO MATCH__>"
|
258
255
|
|
259
256
|
result
|
@@ -314,7 +311,7 @@ module Jekyll
|
|
314
311
|
order = + 1
|
315
312
|
else
|
316
313
|
raise ArgumentError, "Invalid nils order: " \
|
317
|
-
|
314
|
+
"'#{nils}' is not a valid nils order. It must be 'first' or 'last'."
|
318
315
|
end
|
319
316
|
|
320
317
|
sort_input(input, property, order)
|
@@ -481,7 +478,7 @@ module Jekyll
|
|
481
478
|
end
|
482
479
|
|
483
480
|
# ----------- The following set of code was *adapted* from Liquid::If
|
484
|
-
# ----------- ref: https://
|
481
|
+
# ----------- ref: https://github.com/Shopify/liquid/blob/ffb0ace30315bbcf3548a0383fab531452060ae8/lib/liquid/tags/if.rb#L84-L107
|
485
482
|
|
486
483
|
# Parse a string to a Liquid Condition
|
487
484
|
def parse_condition(exp)
|
@@ -198,10 +198,8 @@ module Jekyll
|
|
198
198
|
def matching_sets(path, type)
|
199
199
|
@matched_set_cache ||= {}
|
200
200
|
@matched_set_cache[path] ||= {}
|
201
|
-
@matched_set_cache[path][type] ||=
|
202
|
-
|
203
|
-
!set.key?("scope") || applies?(set["scope"], path, type)
|
204
|
-
end
|
201
|
+
@matched_set_cache[path][type] ||= valid_sets.select do |set|
|
202
|
+
!set.key?("scope") || applies?(set["scope"], path, type)
|
205
203
|
end
|
206
204
|
end
|
207
205
|
|
data/lib/jekyll/hooks.rb
CHANGED
@@ -78,8 +78,8 @@ module Jekyll
|
|
78
78
|
}
|
79
79
|
|
80
80
|
unless @registry[owner][event]
|
81
|
-
raise NotAvailable, "Invalid hook. #{owner} supports only the " \
|
82
|
-
|
81
|
+
raise NotAvailable, "Invalid hook. #{owner} supports only the following hooks " \
|
82
|
+
"#{@registry[owner].keys.inspect}"
|
83
83
|
end
|
84
84
|
|
85
85
|
raise Uncallable, "Hooks must respond to :call" unless block.respond_to? :call
|
data/lib/jekyll/layout.rb
CHANGED
@@ -4,26 +4,14 @@ module Jekyll
|
|
4
4
|
class Layout
|
5
5
|
include Convertible
|
6
6
|
|
7
|
-
#
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
attr_reader :name
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
# Gets the path to this layout relative to its base
|
17
|
-
attr_reader :relative_path
|
18
|
-
|
19
|
-
# Gets/Sets the extension of this layout.
|
20
|
-
attr_accessor :ext
|
21
|
-
|
22
|
-
# Gets/Sets the Hash that holds the metadata for this layout.
|
23
|
-
attr_accessor :data
|
24
|
-
|
25
|
-
# Gets/Sets the content of this layout.
|
26
|
-
attr_accessor :content
|
7
|
+
attr_accessor :content, # content of layout
|
8
|
+
:data, # the Hash that holds the metadata for this layout
|
9
|
+
:ext # extension of layout
|
10
|
+
|
11
|
+
attr_reader :name, # name of layout
|
12
|
+
:path, # path to layout
|
13
|
+
:site, # the Site object
|
14
|
+
:relative_path # path to layout relative to its base
|
27
15
|
|
28
16
|
# Initialize a new Layout.
|
29
17
|
#
|