jekyll 4.0.0.pre.alpha1 → 4.0.0.pre.beta1
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 +4 -3
- data/lib/jekyll.rb +1 -0
- data/lib/jekyll/cache.rb +71 -64
- data/lib/jekyll/cleaner.rb +3 -3
- data/lib/jekyll/collection.rb +4 -2
- data/lib/jekyll/commands/serve/servlet.rb +13 -14
- data/lib/jekyll/commands/serve/websockets.rb +1 -1
- data/lib/jekyll/configuration.rb +33 -124
- data/lib/jekyll/converters/markdown/kramdown_parser.rb +0 -8
- data/lib/jekyll/convertible.rb +1 -1
- data/lib/jekyll/document.rb +39 -28
- data/lib/jekyll/drops/drop.rb +14 -8
- data/lib/jekyll/drops/site_drop.rb +11 -1
- data/lib/jekyll/drops/url_drop.rb +43 -0
- data/lib/jekyll/entry_filter.rb +19 -36
- data/lib/jekyll/excerpt.rb +2 -2
- data/lib/jekyll/filters.rb +37 -6
- data/lib/jekyll/frontmatter_defaults.rb +5 -5
- data/lib/jekyll/liquid_renderer/table.rb +22 -2
- data/lib/jekyll/mime.types +53 -11
- data/lib/jekyll/page.rb +1 -1
- data/lib/jekyll/path_manager.rb +31 -0
- data/lib/jekyll/reader.rb +4 -1
- data/lib/jekyll/readers/page_reader.rb +4 -5
- data/lib/jekyll/readers/post_reader.rb +1 -1
- data/lib/jekyll/readers/static_file_reader.rb +2 -3
- data/lib/jekyll/site.rb +4 -4
- data/lib/jekyll/tags/highlight.rb +2 -4
- data/lib/jekyll/tags/include.rb +5 -4
- data/lib/jekyll/tags/post_url.rb +8 -5
- data/lib/jekyll/theme.rb +13 -2
- data/lib/jekyll/url.rb +7 -3
- data/lib/jekyll/utils.rb +9 -13
- data/lib/jekyll/utils/platforms.rb +1 -1
- data/lib/jekyll/version.rb +1 -1
- metadata +13 -11
@@ -9,14 +9,13 @@ module Jekyll
|
|
9
9
|
@unfiltered_content = []
|
10
10
|
end
|
11
11
|
|
12
|
-
#
|
13
|
-
# object for each file.
|
12
|
+
# Create a new `Jekyll::Page` object for each entry in a given array.
|
14
13
|
#
|
15
|
-
#
|
14
|
+
# files - An array of file names inside `@dir`
|
16
15
|
#
|
17
|
-
# Returns an array of
|
16
|
+
# Returns an array of publishable `Jekyll::Page` objects.
|
18
17
|
def read(files)
|
19
|
-
files.
|
18
|
+
files.each do |page|
|
20
19
|
@unfiltered_content << Page.new(@site, @site.source, @dir, page)
|
21
20
|
end
|
22
21
|
@unfiltered_content.select { |page| site.publisher.publish?(page) }
|
@@ -50,7 +50,7 @@ module Jekyll
|
|
50
50
|
# Returns klass type of content files
|
51
51
|
def read_content(dir, magic_dir, matcher)
|
52
52
|
@site.reader.get_entries(dir, magic_dir).map do |entry|
|
53
|
-
next unless entry
|
53
|
+
next unless matcher.match?(entry)
|
54
54
|
|
55
55
|
path = @site.in_source_dir(File.join(dir, magic_dir, entry))
|
56
56
|
Document.new(path,
|
@@ -9,10 +9,9 @@ module Jekyll
|
|
9
9
|
@unfiltered_content = []
|
10
10
|
end
|
11
11
|
|
12
|
-
#
|
13
|
-
# object for each file.
|
12
|
+
# Create a new StaticFile object for every entry in a given list of basenames.
|
14
13
|
#
|
15
|
-
#
|
14
|
+
# files - an array of file basenames.
|
16
15
|
#
|
17
16
|
# Returns an array of static files.
|
18
17
|
def read(files)
|
data/lib/jekyll/site.rb
CHANGED
@@ -326,15 +326,15 @@ module Jekyll
|
|
326
326
|
#
|
327
327
|
# Returns an Array of Documents which should be written
|
328
328
|
def docs_to_write
|
329
|
-
|
329
|
+
documents.select(&:write?)
|
330
330
|
end
|
331
331
|
|
332
332
|
# Get all the documents
|
333
333
|
#
|
334
334
|
# Returns an Array of all Documents
|
335
335
|
def documents
|
336
|
-
|
337
|
-
|
336
|
+
collections.each_with_object(Set.new) do |(_, collection), set|
|
337
|
+
set.merge(collection.docs).merge(collection.files)
|
338
338
|
end.to_a
|
339
339
|
end
|
340
340
|
|
@@ -469,7 +469,7 @@ module Jekyll
|
|
469
469
|
|
470
470
|
# Disable Marshaling cache to disk in Safe Mode
|
471
471
|
def configure_cache
|
472
|
-
Jekyll::Cache.
|
472
|
+
Jekyll::Cache.cache_dir = in_source_dir(config["cache_dir"], "Jekyll/Cache")
|
473
473
|
Jekyll::Cache.disable_disk_cache! if safe
|
474
474
|
end
|
475
475
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Jekyll
|
4
4
|
module Tags
|
5
|
-
class HighlightBlock < Liquid::
|
5
|
+
class HighlightBlock < Liquid::Block
|
6
6
|
include Liquid::StandardFilters
|
7
7
|
|
8
8
|
# The regular expression syntax checker. Start with the language specifier.
|
@@ -33,7 +33,7 @@ module Jekyll
|
|
33
33
|
def render(context)
|
34
34
|
prefix = context["highlighter_prefix"] || ""
|
35
35
|
suffix = context["highlighter_suffix"] || ""
|
36
|
-
code
|
36
|
+
code = super.to_s.gsub(LEADING_OR_TRAILING_LINE_TERMINATORS, "")
|
37
37
|
|
38
38
|
output =
|
39
39
|
case context.registers[:site].highlighter
|
@@ -103,8 +103,6 @@ module Jekyll
|
|
103
103
|
"<figure class=\"highlight\"><pre><code #{code_attributes}>"\
|
104
104
|
"#{code.chomp}</code></pre></figure>"
|
105
105
|
end
|
106
|
-
|
107
|
-
def ensure_valid_markup(tag_name, markup, parse_context); end
|
108
106
|
end
|
109
107
|
end
|
110
108
|
end
|
data/lib/jekyll/tags/include.rb
CHANGED
@@ -54,7 +54,7 @@ module Jekyll
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def validate_file_name(file)
|
57
|
-
if file
|
57
|
+
if INVALID_SEQUENCES.match?(file) || !VALID_FILENAME_CHARS.match?(file)
|
58
58
|
raise ArgumentError, <<~MSG
|
59
59
|
Invalid syntax for include tag. File contains invalid characters or sequences:
|
60
60
|
|
@@ -69,7 +69,7 @@ module Jekyll
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def validate_params
|
72
|
-
unless @params
|
72
|
+
unless FULL_VALID_SYNTAX.match?(@params)
|
73
73
|
raise ArgumentError, <<~MSG
|
74
74
|
Invalid syntax for include tag:
|
75
75
|
|
@@ -90,7 +90,7 @@ module Jekyll
|
|
90
90
|
|
91
91
|
# Render the variable if required
|
92
92
|
def render_variable(context)
|
93
|
-
Liquid::Template.parse(@file).render(context) if @file
|
93
|
+
Liquid::Template.parse(@file).render(context) if VARIABLE_SYNTAX.match?(@file)
|
94
94
|
end
|
95
95
|
|
96
96
|
def tag_includes_dirs(context)
|
@@ -100,7 +100,7 @@ module Jekyll
|
|
100
100
|
def locate_include_file(context, file, safe)
|
101
101
|
includes_dirs = tag_includes_dirs(context)
|
102
102
|
includes_dirs.each do |dir|
|
103
|
-
path =
|
103
|
+
path = PathManager.join(dir, file)
|
104
104
|
return path if valid_include_file?(path, dir.to_s, safe)
|
105
105
|
end
|
106
106
|
raise IOError, could_not_locate_message(file, includes_dirs, safe)
|
@@ -209,6 +209,7 @@ module Jekyll
|
|
209
209
|
else
|
210
210
|
File.join(site.config["collections_dir"], page_payload["path"])
|
211
211
|
end
|
212
|
+
resource_path.sub!(%r!/#excerpt\z!, "")
|
212
213
|
site.in_source_dir File.dirname(resource_path)
|
213
214
|
end
|
214
215
|
end
|
data/lib/jekyll/tags/post_url.rb
CHANGED
@@ -57,6 +57,8 @@ module Jekyll
|
|
57
57
|
end
|
58
58
|
|
59
59
|
class PostUrl < Liquid::Tag
|
60
|
+
include Jekyll::Filters::URLFilters
|
61
|
+
|
60
62
|
def initialize(tag_name, post, tokens)
|
61
63
|
super
|
62
64
|
@orig_post = post.strip
|
@@ -72,24 +74,25 @@ module Jekyll
|
|
72
74
|
end
|
73
75
|
|
74
76
|
def render(context)
|
77
|
+
@context = context
|
75
78
|
site = context.registers[:site]
|
76
79
|
|
77
|
-
site.posts.docs.each do |
|
78
|
-
return
|
80
|
+
site.posts.docs.each do |document|
|
81
|
+
return relative_url(document) if @post == document
|
79
82
|
end
|
80
83
|
|
81
84
|
# New matching method did not match, fall back to old method
|
82
85
|
# with deprecation warning if this matches
|
83
86
|
|
84
|
-
site.posts.docs.each do |
|
85
|
-
next unless @post.deprecated_equality
|
87
|
+
site.posts.docs.each do |document|
|
88
|
+
next unless @post.deprecated_equality document
|
86
89
|
|
87
90
|
Jekyll::Deprecator.deprecation_message "A call to "\
|
88
91
|
"'{% post_url #{@post.name} %}' did not match " \
|
89
92
|
"a post using the new matching method of checking name " \
|
90
93
|
"(path-date-slug) equality. Please make sure that you " \
|
91
94
|
"change this tag to match the post's name exactly."
|
92
|
-
return
|
95
|
+
return relative_url(document)
|
93
96
|
end
|
94
97
|
|
95
98
|
raise Jekyll::Errors::PostURLError, <<~MSG
|
data/lib/jekyll/theme.rb
CHANGED
@@ -62,11 +62,22 @@ module Jekyll
|
|
62
62
|
# escape the theme root.
|
63
63
|
# However, symlinks are allowed to point to other directories within the theme.
|
64
64
|
Jekyll.sanitized_path(root, File.realpath(Jekyll.sanitized_path(root, folder.to_s)))
|
65
|
-
rescue Errno::ENOENT, Errno::EACCES, Errno::ELOOP
|
66
|
-
|
65
|
+
rescue Errno::ENOENT, Errno::EACCES, Errno::ELOOP => e
|
66
|
+
log_realpath_exception(e, folder)
|
67
67
|
nil
|
68
68
|
end
|
69
69
|
|
70
|
+
def log_realpath_exception(err, folder)
|
71
|
+
return if err.is_a?(Errno::ENOENT)
|
72
|
+
|
73
|
+
case err
|
74
|
+
when Errno::EACCES
|
75
|
+
Jekyll.logger.error "Theme error:", "Directory '#{folder}' is not accessible."
|
76
|
+
when Errno::ELOOP
|
77
|
+
Jekyll.logger.error "Theme error:", "Directory '#{folder}' includes a symbolic link loop."
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
70
81
|
def gemspec
|
71
82
|
@gemspec ||= Gem::Specification.find_by_name(name)
|
72
83
|
rescue Gem::LoadError
|
data/lib/jekyll/url.rb
CHANGED
@@ -129,6 +129,8 @@ module Jekyll
|
|
129
129
|
#
|
130
130
|
# Returns the escaped path.
|
131
131
|
def self.escape_path(path)
|
132
|
+
return path if path.empty? || %r!^[a-zA-Z0-9./-]+$!.match?(path)
|
133
|
+
|
132
134
|
# Because URI.escape doesn't escape "?", "[" and "]" by default,
|
133
135
|
# specify unsafe string (except unreserved, sub-delims, ":", "@" and "/").
|
134
136
|
#
|
@@ -139,8 +141,7 @@ module Jekyll
|
|
139
141
|
# pct-encoded = "%" HEXDIG HEXDIG
|
140
142
|
# sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
|
141
143
|
# / "*" / "+" / "," / ";" / "="
|
142
|
-
|
143
|
-
path.encode("utf-8").sub("#", "%23")
|
144
|
+
Addressable::URI.encode(path).encode("utf-8").sub("#", "%23")
|
144
145
|
end
|
145
146
|
|
146
147
|
# Unescapes a URL path segment
|
@@ -154,7 +155,10 @@ module Jekyll
|
|
154
155
|
#
|
155
156
|
# Returns the unescaped path.
|
156
157
|
def self.unescape_path(path)
|
157
|
-
|
158
|
+
path = path.encode("utf-8")
|
159
|
+
return path unless path.include?("%")
|
160
|
+
|
161
|
+
Addressable::URI.unencode(path)
|
158
162
|
end
|
159
163
|
end
|
160
164
|
end
|
data/lib/jekyll/utils.rb
CHANGED
@@ -17,14 +17,7 @@ module Jekyll
|
|
17
17
|
SLUGIFY_PRETTY_REGEXP = Regexp.new("[^[:alnum:]._~!$&'()+,;=@]+").freeze
|
18
18
|
SLUGIFY_ASCII_REGEXP = Regexp.new("[^[A-Za-z0-9]]+").freeze
|
19
19
|
|
20
|
-
# Takes an indented string and removes the preceding spaces on each line
|
21
|
-
|
22
|
-
def strip_heredoc(str)
|
23
|
-
str.gsub(%r!^[ \t]{#{(str.scan(%r!^[ \t]*(?=\S)!).min || "").size}}!, "")
|
24
|
-
end
|
25
|
-
|
26
20
|
# Takes a slug and turns it into a simple title.
|
27
|
-
|
28
21
|
def titleize_slug(slug)
|
29
22
|
slug.split("-").map!(&:capitalize).join(" ")
|
30
23
|
end
|
@@ -75,11 +68,14 @@ module Jekyll
|
|
75
68
|
#
|
76
69
|
# Returns an array
|
77
70
|
def pluralized_array_from_hash(hash, singular_key, plural_key)
|
78
|
-
[]
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
71
|
+
array = []
|
72
|
+
value = value_from_singular_key(hash, singular_key)
|
73
|
+
value ||= value_from_plural_key(hash, plural_key)
|
74
|
+
|
75
|
+
array << value
|
76
|
+
array.flatten!
|
77
|
+
array.compact!
|
78
|
+
array
|
83
79
|
end
|
84
80
|
|
85
81
|
def value_from_singular_key(hash, key)
|
@@ -142,7 +138,7 @@ module Jekyll
|
|
142
138
|
# Returns true if the YAML front matter is present.
|
143
139
|
# rubocop: disable PredicateName
|
144
140
|
def has_yaml_header?(file)
|
145
|
-
|
141
|
+
File.open(file, "rb", &:readline).match? %r!\A---\s*\r?\n!
|
146
142
|
rescue EOFError
|
147
143
|
false
|
148
144
|
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.0.0.pre.
|
4
|
+
version: 4.0.0.pre.beta1
|
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: 2019-
|
13
|
+
date: 2019-08-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: addressable
|
@@ -273,6 +273,7 @@ files:
|
|
273
273
|
- lib/jekyll/mime.types
|
274
274
|
- lib/jekyll/page.rb
|
275
275
|
- lib/jekyll/page_without_a_file.rb
|
276
|
+
- lib/jekyll/path_manager.rb
|
276
277
|
- lib/jekyll/plugin.rb
|
277
278
|
- lib/jekyll/plugin_manager.rb
|
278
279
|
- lib/jekyll/publisher.rb
|
@@ -337,7 +338,7 @@ metadata:
|
|
337
338
|
homepage_uri: https://jekyllrb.com
|
338
339
|
source_code_uri: https://github.com/jekyll/jekyll
|
339
340
|
post_install_message: |
|
340
|
-
|
341
|
+
-------------------------------------------------------------------------------------
|
341
342
|
This version of Jekyll comes with some major changes.
|
342
343
|
|
343
344
|
Most notably:
|
@@ -345,13 +346,14 @@ post_install_message: |
|
|
345
346
|
You should no longer prepend `{{ site.baseurl }}` to `{% link foo.md %}`
|
346
347
|
For further details: https://github.com/jekyll/jekyll/pull/6727
|
347
348
|
|
348
|
-
* Our `
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
349
|
+
* Our `post_url` tag now comes with the `relative_url` filter incorporated into it.
|
350
|
+
You shouldn't prepend `{{ site.baseurl }}` to `{% post_url 2019-03-27-hello %}`
|
351
|
+
For further details: https://github.com/jekyll/jekyll/pull/7589
|
352
|
+
|
353
|
+
* Support for deprecated configuration options has been removed. We will no longer
|
354
|
+
output a warning and gracefully assign their values to the newer counterparts
|
355
|
+
internally.
|
356
|
+
-------------------------------------------------------------------------------------
|
355
357
|
rdoc_options:
|
356
358
|
- "--charset=UTF-8"
|
357
359
|
require_paths:
|
@@ -367,7 +369,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
367
369
|
- !ruby/object:Gem::Version
|
368
370
|
version: 2.7.0
|
369
371
|
requirements: []
|
370
|
-
rubygems_version: 3.0.
|
372
|
+
rubygems_version: 3.0.4
|
371
373
|
signing_key:
|
372
374
|
specification_version: 4
|
373
375
|
summary: A simple, blog aware, static site generator.
|