jekyll 4.1.1 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +150 -4
- data/README.markdown +2 -6
- data/lib/blank_template/_layouts/default.html +1 -1
- data/lib/jekyll.rb +2 -16
- data/lib/jekyll/cleaner.rb +1 -1
- data/lib/jekyll/commands/doctor.rb +19 -15
- data/lib/jekyll/commands/new_theme.rb +0 -2
- data/lib/jekyll/commands/serve.rb +3 -0
- data/lib/jekyll/configuration.rb +11 -14
- data/lib/jekyll/convertible.rb +17 -11
- data/lib/jekyll/document.rb +20 -12
- data/lib/jekyll/drops/collection_drop.rb +3 -3
- data/lib/jekyll/drops/document_drop.rb +4 -15
- data/lib/jekyll/drops/drop.rb +98 -20
- data/lib/jekyll/drops/site_drop.rb +3 -3
- data/lib/jekyll/drops/static_file_drop.rb +4 -4
- data/lib/jekyll/drops/url_drop.rb +2 -2
- data/lib/jekyll/filters.rb +6 -9
- data/lib/jekyll/filters/url_filters.rb +5 -2
- data/lib/jekyll/frontmatter_defaults.rb +2 -2
- data/lib/jekyll/hooks.rb +20 -16
- data/lib/jekyll/layout.rb +5 -0
- data/lib/jekyll/page.rb +20 -13
- data/lib/jekyll/path_manager.rb +53 -10
- data/lib/jekyll/reader.rb +11 -6
- data/lib/jekyll/readers/data_reader.rb +3 -0
- data/lib/jekyll/readers/post_reader.rb +1 -1
- data/lib/jekyll/related_posts.rb +1 -1
- data/lib/jekyll/renderer.rb +8 -4
- data/lib/jekyll/site.rb +17 -2
- data/lib/jekyll/static_file.rb +2 -2
- data/lib/jekyll/tags/include.rb +21 -27
- data/lib/jekyll/tags/link.rb +2 -1
- data/lib/jekyll/tags/post_url.rb +3 -4
- data/lib/jekyll/url.rb +8 -5
- data/lib/jekyll/utils/platforms.rb +34 -49
- data/lib/jekyll/version.rb +1 -1
- metadata +7 -7
data/lib/jekyll/tags/link.rb
CHANGED
@@ -21,11 +21,12 @@ module Jekyll
|
|
21
21
|
@context = context
|
22
22
|
site = context.registers[:site]
|
23
23
|
relative_path = Liquid::Template.parse(@relative_path).render(context)
|
24
|
+
relative_path_with_leading_slash = PathManager.join("", relative_path)
|
24
25
|
|
25
26
|
site.each_site_file do |item|
|
26
27
|
return relative_url(item) if item.relative_path == relative_path
|
27
28
|
# This takes care of the case for static files that have a leading /
|
28
|
-
return relative_url(item) if item.relative_path ==
|
29
|
+
return relative_url(item) if item.relative_path == relative_path_with_leading_slash
|
29
30
|
end
|
30
31
|
|
31
32
|
raise ArgumentError, <<~MSG
|
data/lib/jekyll/tags/post_url.rb
CHANGED
@@ -16,9 +16,8 @@ module Jekyll
|
|
16
16
|
"'#{name}' does not contain valid date and/or title."
|
17
17
|
end
|
18
18
|
|
19
|
-
|
20
|
-
@name_regex = %r!^_posts/#{path}#{
|
21
|
-
^#{path}_posts/?#{date}-#{escaped_slug}\.[^.]+!x
|
19
|
+
basename_pattern = "#{date}-#{Regexp.escape(slug)}\\.[^.]+"
|
20
|
+
@name_regex = %r!^_posts/#{path}#{basename_pattern}|^#{path}_posts/?#{basename_pattern}!
|
22
21
|
end
|
23
22
|
|
24
23
|
def post_date
|
@@ -51,7 +50,7 @@ module Jekyll
|
|
51
50
|
if path.nil? || path == ""
|
52
51
|
other.data["slug"]
|
53
52
|
else
|
54
|
-
path
|
53
|
+
"#{path}/#{other.data["slug"]}"
|
55
54
|
end
|
56
55
|
end
|
57
56
|
end
|
data/lib/jekyll/url.rb
CHANGED
@@ -94,7 +94,8 @@ module Jekyll
|
|
94
94
|
|
95
95
|
def generate_url_from_drop(template)
|
96
96
|
template.gsub(%r!:([a-z_]+)!) do |match|
|
97
|
-
|
97
|
+
name = Regexp.last_match(1)
|
98
|
+
pool = name.end_with?("_") ? [name, name.chomp!("_")] : [name]
|
98
99
|
|
99
100
|
winner = pool.find { |key| @placeholders.key?(key) }
|
100
101
|
if winner.nil?
|
@@ -107,15 +108,17 @@ module Jekyll
|
|
107
108
|
value = "" if value.nil?
|
108
109
|
replacement = self.class.escape_path(value)
|
109
110
|
|
110
|
-
match.sub(":#{winner}", replacement)
|
111
|
-
end
|
111
|
+
match.sub!(":#{winner}", replacement)
|
112
|
+
end
|
112
113
|
end
|
113
114
|
|
114
115
|
# Returns a sanitized String URL, stripping "../../" and multiples of "/",
|
115
116
|
# as well as the beginning "/" so we can enforce and ensure it.
|
116
|
-
|
117
117
|
def sanitize_url(str)
|
118
|
-
"/#{str}".gsub("..", "/").
|
118
|
+
"/#{str}".gsub("..", "/").tap do |result|
|
119
|
+
result.gsub!("./", "")
|
120
|
+
result.squeeze!("/")
|
121
|
+
end
|
119
122
|
end
|
120
123
|
|
121
124
|
# Escapes a path to be a valid URL path segment
|
@@ -5,78 +5,63 @@ module Jekyll
|
|
5
5
|
module Platforms
|
6
6
|
extend self
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
def jruby?
|
9
|
+
RUBY_ENGINE == "jruby"
|
10
|
+
end
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
::RUBY_ENGINE == v
|
15
|
-
end
|
12
|
+
def mri?
|
13
|
+
RUBY_ENGINE == "ruby"
|
16
14
|
end
|
17
15
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
# /proc/version returns nothing to us.
|
22
|
-
# --
|
16
|
+
def windows?
|
17
|
+
vanilla_windows? || bash_on_windows?
|
18
|
+
end
|
23
19
|
|
20
|
+
# Not a Windows Subsystem for Linux (WSL)
|
24
21
|
def vanilla_windows?
|
25
|
-
|
26
|
-
!proc_version
|
22
|
+
rbconfig_host.match?(%r!mswin|mingw|cygwin!) && proc_version.empty?
|
27
23
|
end
|
24
|
+
alias_method :really_windows?, :vanilla_windows?
|
28
25
|
|
29
|
-
#
|
30
|
-
# XXX: Remove in 4.0
|
31
|
-
# --
|
32
|
-
|
33
|
-
alias_method :really_windows?, \
|
34
|
-
:vanilla_windows?
|
35
|
-
|
36
|
-
#
|
37
|
-
|
26
|
+
# Determine if Windows Subsystem for Linux (WSL)
|
38
27
|
def bash_on_windows?
|
39
|
-
|
40
|
-
proc_version =~ %r!microsoft!i
|
28
|
+
linux_os? && microsoft_proc_version?
|
41
29
|
end
|
42
30
|
|
43
|
-
#
|
44
|
-
|
45
|
-
def windows?
|
46
|
-
vanilla_windows? || bash_on_windows?
|
47
|
-
end
|
48
|
-
|
49
|
-
#
|
50
|
-
|
51
31
|
def linux?
|
52
|
-
|
53
|
-
proc_version !~ %r!microsoft!i
|
32
|
+
linux_os? && !microsoft_proc_version?
|
54
33
|
end
|
55
34
|
|
56
|
-
|
57
|
-
|
58
|
-
# where we kick off certain tests based on the platform.
|
59
|
-
|
60
|
-
{ :osx? => %r!darwin|mac os!, :unix? => %r!solaris|bsd! }.each do |k, v|
|
61
|
-
define_method k do
|
62
|
-
!!(
|
63
|
-
RbConfig::CONFIG["host_os"] =~ v
|
64
|
-
)
|
65
|
-
end
|
35
|
+
def osx?
|
36
|
+
rbconfig_host.match?(%r!darwin|mac os!)
|
66
37
|
end
|
67
38
|
|
68
|
-
|
39
|
+
def unix?
|
40
|
+
rbconfig_host.match?(%r!solaris|bsd!)
|
41
|
+
end
|
69
42
|
|
70
43
|
private
|
71
44
|
|
72
45
|
def proc_version
|
73
|
-
@proc_version ||=
|
46
|
+
@proc_version ||= \
|
74
47
|
begin
|
75
|
-
File.read("/proc/version")
|
48
|
+
File.read("/proc/version").downcase
|
76
49
|
rescue Errno::ENOENT, Errno::EACCES
|
77
|
-
|
50
|
+
""
|
78
51
|
end
|
79
52
|
end
|
53
|
+
|
54
|
+
def rbconfig_host
|
55
|
+
@rbconfig_host ||= RbConfig::CONFIG["host_os"].downcase
|
56
|
+
end
|
57
|
+
|
58
|
+
def linux_os?
|
59
|
+
rbconfig_host.include?("linux")
|
60
|
+
end
|
61
|
+
|
62
|
+
def microsoft_proc_version?
|
63
|
+
proc_version.include?("microsoft")
|
64
|
+
end
|
80
65
|
end
|
81
66
|
end
|
82
67
|
end
|
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.
|
4
|
+
version: 4.2.0
|
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: 2020-
|
13
|
+
date: 2020-12-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: addressable
|
@@ -102,14 +102,14 @@ dependencies:
|
|
102
102
|
requirements:
|
103
103
|
- - "~>"
|
104
104
|
- !ruby/object:Gem::Version
|
105
|
-
version: '2.
|
105
|
+
version: '2.3'
|
106
106
|
type: :runtime
|
107
107
|
prerelease: false
|
108
108
|
version_requirements: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
110
|
- - "~>"
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
version: '2.
|
112
|
+
version: '2.3'
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: kramdown-parser-gfm
|
115
115
|
requirement: !ruby/object:Gem::Requirement
|
@@ -200,14 +200,14 @@ dependencies:
|
|
200
200
|
requirements:
|
201
201
|
- - "~>"
|
202
202
|
- !ruby/object:Gem::Version
|
203
|
-
version: '
|
203
|
+
version: '2.0'
|
204
204
|
type: :runtime
|
205
205
|
prerelease: false
|
206
206
|
version_requirements: !ruby/object:Gem::Requirement
|
207
207
|
requirements:
|
208
208
|
- - "~>"
|
209
209
|
- !ruby/object:Gem::Version
|
210
|
-
version: '
|
210
|
+
version: '2.0'
|
211
211
|
description: Jekyll is a simple, blog aware, static site generator.
|
212
212
|
email:
|
213
213
|
- maintainers@jekyllrb.com
|
@@ -364,7 +364,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
364
364
|
- !ruby/object:Gem::Version
|
365
365
|
version: 2.7.0
|
366
366
|
requirements: []
|
367
|
-
rubygems_version: 3.1.
|
367
|
+
rubygems_version: 3.1.4
|
368
368
|
signing_key:
|
369
369
|
specification_version: 4
|
370
370
|
summary: A simple, blog aware, static site generator.
|