jekyll 4.0.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/lib/jekyll/convertible.rb +1 -1
- data/lib/jekyll/document.rb +5 -5
- data/lib/jekyll/filters.rb +7 -4
- data/lib/jekyll/liquid_renderer/file.rb +10 -0
- data/lib/jekyll/static_file.rb +1 -1
- data/lib/jekyll/tags/include.rb +1 -1
- data/lib/jekyll/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0562e1d33bdfbe9a42636335c4f4d9c9da442ec3887886536f888720c9a87b9b
|
4
|
+
data.tar.gz: 8561a49dec1141a1b7c111939a8220113d5e01e51605f0eba76536ab06b265c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbccdaab958f04e2175e8b224b5495fcf5a55703a559e9f1f96b7821601f28b0db0545a96f4119314274751051ec300f1121ec0d0988a203c2cc99de37b71325
|
7
|
+
data.tar.gz: afa55cd05bcabfb2a3749c6ed0968039742068c440132ce786b6d2b3ab89458deba2652ec8363b686891c403d127e5177fe296acd85808eaf45f6bf58a934978
|
data/.rubocop.yml
CHANGED
data/lib/jekyll/convertible.rb
CHANGED
@@ -39,7 +39,7 @@ module Jekyll
|
|
39
39
|
|
40
40
|
begin
|
41
41
|
self.content = File.read(@path || site.in_source_dir(base, name),
|
42
|
-
Utils.merged_file_read_opts(site, opts))
|
42
|
+
**Utils.merged_file_read_opts(site, opts))
|
43
43
|
if content =~ Document::YAML_FRONT_MATTER_REGEXP
|
44
44
|
self.content = $POSTMATCH
|
45
45
|
self.data = SafeYAML.load(Regexp.last_match(1))
|
data/lib/jekyll/document.rb
CHANGED
@@ -298,7 +298,7 @@ module Jekyll
|
|
298
298
|
else
|
299
299
|
begin
|
300
300
|
merge_defaults
|
301
|
-
read_content(opts)
|
301
|
+
read_content(**opts)
|
302
302
|
read_post_data
|
303
303
|
rescue StandardError => e
|
304
304
|
handle_read_error(e)
|
@@ -429,14 +429,14 @@ module Jekyll
|
|
429
429
|
categories.flatten!
|
430
430
|
categories.uniq!
|
431
431
|
|
432
|
-
merge_data!("categories" => categories)
|
432
|
+
merge_data!({ "categories" => categories })
|
433
433
|
end
|
434
434
|
|
435
435
|
def populate_tags
|
436
436
|
tags = Utils.pluralized_array_from_hash(data, "tag", "tags")
|
437
437
|
tags.flatten!
|
438
438
|
|
439
|
-
merge_data!("tags" => tags)
|
439
|
+
merge_data!({ "tags" => tags })
|
440
440
|
end
|
441
441
|
|
442
442
|
private
|
@@ -462,8 +462,8 @@ module Jekyll
|
|
462
462
|
merge_data!(defaults, :source => "front matter defaults") unless defaults.empty?
|
463
463
|
end
|
464
464
|
|
465
|
-
def read_content(opts)
|
466
|
-
self.content = File.read(path, Utils.merged_file_read_opts(site, opts))
|
465
|
+
def read_content(**opts)
|
466
|
+
self.content = File.read(path, **Utils.merged_file_read_opts(site, opts))
|
467
467
|
if content =~ YAML_FRONT_MATTER_REGEXP
|
468
468
|
self.content = $POSTMATCH
|
469
469
|
data_file = SafeYAML.load(Regexp.last_match(1))
|
data/lib/jekyll/filters.rb
CHANGED
@@ -368,15 +368,18 @@ module Jekyll
|
|
368
368
|
end
|
369
369
|
end
|
370
370
|
|
371
|
-
|
371
|
+
FLOAT_LIKE = %r!\A\s*-?(?:\d+\.?\d*|\.\d+)\s*\Z!.freeze
|
372
|
+
INTEGER_LIKE = %r!\A\s*-?\d+\s*\Z!.freeze
|
373
|
+
private_constant :FLOAT_LIKE, :INTEGER_LIKE
|
374
|
+
|
372
375
|
# return numeric values as numbers for proper sorting
|
373
376
|
def parse_sort_input(property)
|
374
|
-
|
375
|
-
return property.
|
377
|
+
stringified = property.to_s
|
378
|
+
return property.to_i if INTEGER_LIKE.match?(stringified)
|
379
|
+
return property.to_f if FLOAT_LIKE.match?(stringified)
|
376
380
|
|
377
381
|
property
|
378
382
|
end
|
379
|
-
# rubocop:enable Performance/RegexpMatch
|
380
383
|
|
381
384
|
def as_liquid(item)
|
382
385
|
case item
|
@@ -18,6 +18,8 @@ module Jekyll
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def render(*args)
|
21
|
+
reset_template_assigns
|
22
|
+
|
21
23
|
measure_time do
|
22
24
|
measure_bytes do
|
23
25
|
measure_counts do
|
@@ -29,6 +31,8 @@ module Jekyll
|
|
29
31
|
|
30
32
|
# This method simply 'rethrows any error' before attempting to render the template.
|
31
33
|
def render!(*args)
|
34
|
+
reset_template_assigns
|
35
|
+
|
32
36
|
measure_time do
|
33
37
|
measure_bytes do
|
34
38
|
measure_counts do
|
@@ -44,6 +48,12 @@ module Jekyll
|
|
44
48
|
|
45
49
|
private
|
46
50
|
|
51
|
+
# clear assigns to `Liquid::Template` instance prior to rendering since
|
52
|
+
# `Liquid::Template` instances are cached in Jekyll 4.
|
53
|
+
def reset_template_assigns
|
54
|
+
@template.instance_assigns.clear
|
55
|
+
end
|
56
|
+
|
47
57
|
def measure_counts
|
48
58
|
@renderer.increment_count(@filename)
|
49
59
|
yield
|
data/lib/jekyll/static_file.rb
CHANGED
data/lib/jekyll/tags/include.rb
CHANGED
data/lib/jekyll/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Preston-Werner
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2020-05-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: addressable
|
@@ -382,7 +382,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
382
382
|
- !ruby/object:Gem::Version
|
383
383
|
version: 2.7.0
|
384
384
|
requirements: []
|
385
|
-
rubygems_version: 3.
|
385
|
+
rubygems_version: 3.1.2
|
386
386
|
signing_key:
|
387
387
|
specification_version: 4
|
388
388
|
summary: A simple, blog aware, static site generator.
|