jekyll 3.4.5 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of jekyll might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.rubocop.yml +38 -30
- data/exe/jekyll +2 -2
- data/lib/jekyll/collection.rb +2 -2
- data/lib/jekyll/command.rb +5 -0
- data/lib/jekyll/commands/new.rb +1 -1
- data/lib/jekyll/commands/serve.rb +7 -6
- data/lib/jekyll/configuration.rb +64 -42
- data/lib/jekyll/converter.rb +2 -2
- data/lib/jekyll/convertible.rb +5 -3
- data/lib/jekyll/document.rb +61 -44
- data/lib/jekyll/drops/site_drop.rb +4 -0
- data/lib/jekyll/entry_filter.rb +2 -1
- data/lib/jekyll/errors.rb +5 -4
- data/lib/jekyll/external.rb +14 -1
- data/lib/jekyll/filters.rb +23 -21
- data/lib/jekyll/filters/grouping_filters.rb +1 -1
- data/lib/jekyll/filters/url_filters.rb +22 -4
- data/lib/jekyll/hooks.rb +1 -1
- data/lib/jekyll/liquid_renderer/table.rb +2 -2
- data/lib/jekyll/page.rb +1 -1
- data/lib/jekyll/plugin.rb +1 -1
- data/lib/jekyll/plugin_manager.rb +19 -7
- data/lib/jekyll/reader.rb +1 -0
- data/lib/jekyll/readers/data_reader.rb +8 -2
- data/lib/jekyll/readers/theme_assets_reader.rb +1 -1
- data/lib/jekyll/renderer.rb +113 -66
- data/lib/jekyll/site.rb +5 -1
- data/lib/jekyll/tags/post_url.rb +1 -1
- data/lib/jekyll/theme.rb +4 -0
- data/lib/jekyll/url.rb +1 -8
- data/lib/jekyll/utils/win_tz.rb +2 -2
- data/lib/jekyll/version.rb +1 -1
- data/lib/site_template/404.html +24 -0
- data/lib/site_template/_config.yml +13 -4
- data/lib/site_template/about.md +7 -4
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a657dd9fc0fec7b9b0a13e9eb30aadd5a4c4f36c
|
4
|
+
data.tar.gz: b7012ba4c8d92eb11118adc0869d10dbb3e425a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 351307bc6003b80a90335b757e25655fbf47c578fbabfb93b85774dc74a66c967b814949e8c9c8cd91c2a615ee2d83787f287f5cc59d986b7717a6bff4d5a603
|
7
|
+
data.tar.gz: 90066e7822209f3ce5c62c29ba375de469260551b78363951c6907a5f1231510a2b1e72b8fc808be404a4b3bad1b5119334d270ad0c33e014b10a94d6e014f43
|
data/.rubocop.yml
CHANGED
@@ -4,12 +4,43 @@ AllCops:
|
|
4
4
|
Include:
|
5
5
|
- lib/**/*.rb
|
6
6
|
Exclude:
|
7
|
-
- lib/jekyll/renderer.rb
|
8
7
|
- bin/**/*
|
9
8
|
- exe/**/*
|
10
9
|
- benchmark/**/*
|
11
10
|
- script/**/*
|
12
11
|
- vendor/**/*
|
12
|
+
Layout/AlignArray:
|
13
|
+
Enabled: false
|
14
|
+
Layout/AlignHash:
|
15
|
+
EnforcedHashRocketStyle: table
|
16
|
+
Layout/AlignParameters:
|
17
|
+
Enabled: false
|
18
|
+
Layout/EmptyLinesAroundAccessModifier:
|
19
|
+
Enabled: false
|
20
|
+
Layout/EmptyLinesAroundModuleBody:
|
21
|
+
Enabled: false
|
22
|
+
Layout/EndOfLine:
|
23
|
+
EnforcedStyle: lf
|
24
|
+
Layout/ExtraSpacing:
|
25
|
+
AllowForAlignment: true
|
26
|
+
Layout/FirstParameterIndentation:
|
27
|
+
EnforcedStyle: consistent
|
28
|
+
Layout/IndentationWidth:
|
29
|
+
Severity: error
|
30
|
+
Layout/IndentArray:
|
31
|
+
EnforcedStyle: consistent
|
32
|
+
Layout/IndentHash:
|
33
|
+
EnforcedStyle: consistent
|
34
|
+
Layout/IndentHeredoc:
|
35
|
+
Enabled: false
|
36
|
+
Layout/MultilineMethodCallIndentation:
|
37
|
+
EnforcedStyle: indented
|
38
|
+
Layout/MultilineOperationIndentation:
|
39
|
+
EnforcedStyle: indented
|
40
|
+
Layout/SpaceAroundOperators:
|
41
|
+
Enabled: true
|
42
|
+
Layout/SpaceInsideBrackets:
|
43
|
+
Enabled: false
|
13
44
|
Lint/EndAlignment:
|
14
45
|
Severity: error
|
15
46
|
Lint/UnreachableCode:
|
@@ -36,6 +67,8 @@ Metrics/LineLength:
|
|
36
67
|
- !ruby/regexp /features\/.*.rb/
|
37
68
|
- Rakefile
|
38
69
|
- rake/*.rake
|
70
|
+
- Gemfile
|
71
|
+
- jekyll.gemspec
|
39
72
|
Max: 90
|
40
73
|
Severity: warning
|
41
74
|
Metrics/MethodLength:
|
@@ -58,13 +91,6 @@ Security/YAMLLoad:
|
|
58
91
|
- !ruby/regexp /test\/.*.rb$/
|
59
92
|
Style/Alias:
|
60
93
|
Enabled: false
|
61
|
-
Style/AlignArray:
|
62
|
-
Enabled: false
|
63
|
-
Style/AlignHash:
|
64
|
-
EnforcedHashRocketStyle: table
|
65
|
-
Style/AlignParameters:
|
66
|
-
Enabled: false
|
67
|
-
EnforcedStyle: with_fixed_indentation
|
68
94
|
Style/AndOr:
|
69
95
|
Severity: error
|
70
96
|
Style/Attr:
|
@@ -79,16 +105,8 @@ Style/Documentation:
|
|
79
105
|
- !ruby/regexp /features\/.*.rb$/
|
80
106
|
Style/DoubleNegation:
|
81
107
|
Enabled: false
|
82
|
-
Style/EmptyLinesAroundAccessModifier:
|
83
|
-
Enabled: false
|
84
|
-
Style/EmptyLinesAroundModuleBody:
|
85
|
-
Enabled: false
|
86
|
-
Style/ExtraSpacing:
|
87
|
-
AllowForAlignment: true
|
88
108
|
Style/FileName:
|
89
109
|
Enabled: false
|
90
|
-
Style/FirstParameterIndentation:
|
91
|
-
EnforcedStyle: consistent
|
92
110
|
Style/GuardClause:
|
93
111
|
Enabled: false
|
94
112
|
Style/HashSyntax:
|
@@ -96,18 +114,10 @@ Style/HashSyntax:
|
|
96
114
|
Severity: error
|
97
115
|
Style/IfUnlessModifier:
|
98
116
|
Enabled: false
|
99
|
-
Style/
|
100
|
-
|
101
|
-
Style/IndentHash:
|
102
|
-
EnforcedStyle: consistent
|
103
|
-
Style/IndentationWidth:
|
104
|
-
Severity: error
|
117
|
+
Style/InverseMethods:
|
118
|
+
Enabled: false
|
105
119
|
Style/ModuleFunction:
|
106
120
|
Enabled: false
|
107
|
-
Style/MultilineMethodCallIndentation:
|
108
|
-
EnforcedStyle: indented
|
109
|
-
Style/MultilineOperationIndentation:
|
110
|
-
EnforcedStyle: indented
|
111
121
|
Style/MultilineTernaryOperator:
|
112
122
|
Severity: error
|
113
123
|
Style/PercentLiteralDelimiters:
|
@@ -131,14 +141,12 @@ Style/SignalException:
|
|
131
141
|
EnforcedStyle: only_raise
|
132
142
|
Style/SingleLineMethods:
|
133
143
|
Enabled: false
|
134
|
-
Style/SpaceAroundOperators:
|
135
|
-
Enabled: false
|
136
|
-
Style/SpaceInsideBrackets:
|
137
|
-
Enabled: false
|
138
144
|
Style/StringLiterals:
|
139
145
|
EnforcedStyle: double_quotes
|
140
146
|
Style/StringLiteralsInInterpolation:
|
141
147
|
EnforcedStyle: double_quotes
|
148
|
+
Style/SymbolArray:
|
149
|
+
Enabled: false
|
142
150
|
Style/TrailingCommaInLiteral:
|
143
151
|
EnforcedStyleForMultiline: consistent_comma
|
144
152
|
Style/UnneededCapitalW:
|
data/exe/jekyll
CHANGED
@@ -25,13 +25,13 @@ Mercenary.program(:jekyll) do |p|
|
|
25
25
|
"Layouts directory (defaults to ./_layouts)"
|
26
26
|
p.option "profile", "--profile", "Generate a Liquid rendering profile"
|
27
27
|
|
28
|
-
Jekyll::External.require_if_present(Jekyll::External.blessed_gems) do |g|
|
28
|
+
Jekyll::External.require_if_present(Jekyll::External.blessed_gems) do |g, ver_constraint|
|
29
29
|
cmd = g.split("-").last
|
30
30
|
p.command(cmd.to_sym) do |c|
|
31
31
|
c.syntax cmd
|
32
32
|
c.action do
|
33
33
|
Jekyll.logger.abort_with "You must install the '#{g}' gem" \
|
34
|
-
" to use the 'jekyll #{cmd}' command."
|
34
|
+
" version #{ver_constraint} to use the 'jekyll #{cmd}' command."
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
data/lib/jekyll/collection.rb
CHANGED
@@ -34,7 +34,7 @@ module Jekyll
|
|
34
34
|
if docs.respond_to?(method.to_sym)
|
35
35
|
Jekyll.logger.warn "Deprecation:",
|
36
36
|
"#{label}.#{method} should be changed to #{label}.docs.#{method}."
|
37
|
-
Jekyll.logger.warn "", "Called by #{caller
|
37
|
+
Jekyll.logger.warn "", "Called by #{caller(0..0)}."
|
38
38
|
docs.public_send(method.to_sym, *args, &blck)
|
39
39
|
else
|
40
40
|
super
|
@@ -72,7 +72,7 @@ module Jekyll
|
|
72
72
|
def entries
|
73
73
|
return [] unless exists?
|
74
74
|
@entries ||=
|
75
|
-
Utils.safe_glob(collection_dir, ["**", "*"]).map do |entry|
|
75
|
+
Utils.safe_glob(collection_dir, ["**", "*"], File::FNM_DOTMATCH).map do |entry|
|
76
76
|
entry["#{collection_dir}/"] = ""
|
77
77
|
entry
|
78
78
|
end
|
data/lib/jekyll/command.rb
CHANGED
@@ -37,6 +37,7 @@ module Jekyll
|
|
37
37
|
#
|
38
38
|
# Returns a full Jekyll configuration
|
39
39
|
def configuration_from_options(options)
|
40
|
+
return options if options.is_a?(Jekyll::Configuration)
|
40
41
|
Jekyll.configuration(options)
|
41
42
|
end
|
42
43
|
|
@@ -45,6 +46,7 @@ module Jekyll
|
|
45
46
|
# c - the Jekyll::Command to add these options to
|
46
47
|
#
|
47
48
|
# Returns nothing
|
49
|
+
# rubocop:disable Metrics/MethodLength
|
48
50
|
def add_build_options(c)
|
49
51
|
c.option "config", "--config CONFIG_FILE[,CONFIG_FILE2,...]",
|
50
52
|
Array, "Custom configuration file"
|
@@ -65,7 +67,10 @@ module Jekyll
|
|
65
67
|
c.option "quiet", "-q", "--quiet", "Silence output."
|
66
68
|
c.option "verbose", "-V", "--verbose", "Print verbose output."
|
67
69
|
c.option "incremental", "-I", "--incremental", "Enable incremental rebuild."
|
70
|
+
c.option "strict_front_matter", "--strict_front_matter",
|
71
|
+
"Fail if errors are present in front matter"
|
68
72
|
end
|
73
|
+
# rubocop:enable Metrics/MethodLength
|
69
74
|
end
|
70
75
|
end
|
71
76
|
end
|
data/lib/jekyll/commands/new.rb
CHANGED
@@ -61,7 +61,6 @@ module Jekyll
|
|
61
61
|
def gemfile_contents
|
62
62
|
<<-RUBY
|
63
63
|
source "https://rubygems.org"
|
64
|
-
ruby RUBY_VERSION
|
65
64
|
|
66
65
|
# Hello! This is where you manage which Jekyll version is used to run.
|
67
66
|
# When you want to use a different version, change it below, save the
|
@@ -109,6 +108,7 @@ RUBY
|
|
109
108
|
|
110
109
|
def create_sample_files(path)
|
111
110
|
FileUtils.cp_r site_template + "/.", path
|
111
|
+
FileUtils.chmod_R "u+w", path
|
112
112
|
FileUtils.rm File.expand_path(scaffold_path, path)
|
113
113
|
end
|
114
114
|
|
@@ -32,11 +32,12 @@ module Jekyll
|
|
32
32
|
cmd.action do |_, opts|
|
33
33
|
opts["serving"] = true
|
34
34
|
opts["watch" ] = true unless opts.key?("watch")
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
|
36
|
+
config = configuration_from_options(opts)
|
37
|
+
if Jekyll.env == "development"
|
38
|
+
config["url"] = default_url(config)
|
39
|
+
end
|
40
|
+
[Build, Serve].each { |klass| klass.process(config) }
|
40
41
|
end
|
41
42
|
end
|
42
43
|
end
|
@@ -135,7 +136,7 @@ module Jekyll
|
|
135
136
|
|
136
137
|
private
|
137
138
|
def format_url(ssl_enabled, address, port, baseurl = nil)
|
138
|
-
format("
|
139
|
+
format("%<prefix>s://%<address>s:%<port>i%<baseurl>s", {
|
139
140
|
:prefix => ssl_enabled ? "https" : "http",
|
140
141
|
:address => address,
|
141
142
|
:port => port,
|
data/lib/jekyll/configuration.rb
CHANGED
@@ -6,70 +6,72 @@ module Jekyll
|
|
6
6
|
# Strings rather than symbols are used for compatibility with YAML.
|
7
7
|
DEFAULTS = Configuration[{
|
8
8
|
# Where things are
|
9
|
-
"source"
|
10
|
-
"destination"
|
11
|
-
"plugins_dir"
|
12
|
-
"layouts_dir"
|
13
|
-
"data_dir"
|
14
|
-
"includes_dir"
|
15
|
-
"collections"
|
9
|
+
"source" => Dir.pwd,
|
10
|
+
"destination" => File.join(Dir.pwd, "_site"),
|
11
|
+
"plugins_dir" => "_plugins",
|
12
|
+
"layouts_dir" => "_layouts",
|
13
|
+
"data_dir" => "_data",
|
14
|
+
"includes_dir" => "_includes",
|
15
|
+
"collections" => {},
|
16
16
|
|
17
17
|
# Handling Reading
|
18
|
-
"safe"
|
19
|
-
"include"
|
20
|
-
"exclude"
|
21
|
-
node_modules vendor/bundle/ vendor/cache/ vendor/gems/
|
18
|
+
"safe" => false,
|
19
|
+
"include" => [".htaccess"],
|
20
|
+
"exclude" => %w(
|
21
|
+
Gemfile Gemfile.lock node_modules vendor/bundle/ vendor/cache/ vendor/gems/
|
22
|
+
vendor/ruby/
|
22
23
|
),
|
23
|
-
"keep_files"
|
24
|
-
"encoding"
|
25
|
-
"markdown_ext"
|
24
|
+
"keep_files" => [".git", ".svn"],
|
25
|
+
"encoding" => "utf-8",
|
26
|
+
"markdown_ext" => "markdown,mkdown,mkdn,mkd,md",
|
27
|
+
"strict_front_matter" => false,
|
26
28
|
|
27
29
|
# Filtering Content
|
28
|
-
"show_drafts"
|
29
|
-
"limit_posts"
|
30
|
-
"future"
|
31
|
-
"unpublished"
|
30
|
+
"show_drafts" => nil,
|
31
|
+
"limit_posts" => 0,
|
32
|
+
"future" => false,
|
33
|
+
"unpublished" => false,
|
32
34
|
|
33
35
|
# Plugins
|
34
|
-
"whitelist"
|
35
|
-
"
|
36
|
+
"whitelist" => [],
|
37
|
+
"plugins" => [],
|
36
38
|
|
37
39
|
# Conversion
|
38
|
-
"markdown"
|
39
|
-
"highlighter"
|
40
|
-
"lsi"
|
41
|
-
"excerpt_separator"
|
42
|
-
"incremental"
|
40
|
+
"markdown" => "kramdown",
|
41
|
+
"highlighter" => "rouge",
|
42
|
+
"lsi" => false,
|
43
|
+
"excerpt_separator" => "\n\n",
|
44
|
+
"incremental" => false,
|
43
45
|
|
44
46
|
# Serving
|
45
|
-
"detach"
|
46
|
-
"port"
|
47
|
-
"host"
|
48
|
-
"baseurl"
|
49
|
-
"show_dir_listing"
|
47
|
+
"detach" => false, # default to not detaching the server
|
48
|
+
"port" => "4000",
|
49
|
+
"host" => "127.0.0.1",
|
50
|
+
"baseurl" => nil, # this mounts at /, i.e. no subdirectory
|
51
|
+
"show_dir_listing" => false,
|
50
52
|
|
51
53
|
# Output Configuration
|
52
|
-
"permalink"
|
53
|
-
"paginate_path"
|
54
|
-
"timezone"
|
54
|
+
"permalink" => "date",
|
55
|
+
"paginate_path" => "/page:num",
|
56
|
+
"timezone" => nil, # use the local timezone
|
55
57
|
|
56
|
-
"quiet"
|
57
|
-
"verbose"
|
58
|
-
"defaults"
|
58
|
+
"quiet" => false,
|
59
|
+
"verbose" => false,
|
60
|
+
"defaults" => [],
|
59
61
|
|
60
|
-
"liquid"
|
62
|
+
"liquid" => {
|
61
63
|
"error_mode" => "warn",
|
62
64
|
},
|
63
65
|
|
64
|
-
"rdiscount"
|
66
|
+
"rdiscount" => {
|
65
67
|
"extensions" => [],
|
66
68
|
},
|
67
69
|
|
68
|
-
"redcarpet"
|
70
|
+
"redcarpet" => {
|
69
71
|
"extensions" => [],
|
70
72
|
},
|
71
73
|
|
72
|
-
"kramdown"
|
74
|
+
"kramdown" => {
|
73
75
|
"auto_ids" => true,
|
74
76
|
"toc_levels" => "1..6",
|
75
77
|
"entity_output" => "as_char",
|
@@ -136,7 +138,7 @@ module Jekyll
|
|
136
138
|
SafeYAML.load_file(filename) || {}
|
137
139
|
else
|
138
140
|
raise ArgumentError, "No parser for '#{filename}' is available.
|
139
|
-
Use a .
|
141
|
+
Use a .y(a)ml or .toml file instead."
|
140
142
|
end
|
141
143
|
end
|
142
144
|
|
@@ -228,9 +230,10 @@ module Jekyll
|
|
228
230
|
# Provide backwards-compatibility
|
229
231
|
check_auto(config)
|
230
232
|
check_server(config)
|
233
|
+
check_plugins(config)
|
231
234
|
|
232
235
|
renamed_key "server_port", "port", config
|
233
|
-
renamed_key "
|
236
|
+
renamed_key "gems", "plugins", config
|
234
237
|
renamed_key "layouts", "layouts_dir", config
|
235
238
|
renamed_key "data_source", "data_dir", config
|
236
239
|
|
@@ -384,5 +387,24 @@ module Jekyll
|
|
384
387
|
"`_config.yml` file."
|
385
388
|
end
|
386
389
|
end
|
390
|
+
|
391
|
+
# Private: Checks if the `plugins` config is a String
|
392
|
+
#
|
393
|
+
# config - the config hash
|
394
|
+
#
|
395
|
+
# Raises a Jekyll::Errors::InvalidConfigurationError if the config `plugins`
|
396
|
+
# is a string
|
397
|
+
private
|
398
|
+
def check_plugins(config)
|
399
|
+
if config.key?("plugins") && config["plugins"].is_a?(String)
|
400
|
+
Jekyll.logger.error "Configuration Error:", "You specified the" \
|
401
|
+
" `plugins` config in your configuration file as a string, please" \
|
402
|
+
" use an array instead. If you wanted to set the directory of your" \
|
403
|
+
" plugins, use the config key `plugins_dir` instead."
|
404
|
+
raise Jekyll::Errors::InvalidConfigurationError,
|
405
|
+
"'plugins' should not be a string, but was: " \
|
406
|
+
"#{config["plugins"].inspect}. Use 'plugins_dir' instead."
|
407
|
+
end
|
408
|
+
end
|
387
409
|
end
|
388
410
|
end
|
data/lib/jekyll/converter.rb
CHANGED
@@ -8,7 +8,7 @@ module Jekyll
|
|
8
8
|
#
|
9
9
|
# Returns the String prefix.
|
10
10
|
def self.highlighter_prefix(highlighter_prefix = nil)
|
11
|
-
|
11
|
+
unless defined?(@highlighter_prefix) && highlighter_prefix.nil?
|
12
12
|
@highlighter_prefix = highlighter_prefix
|
13
13
|
end
|
14
14
|
@highlighter_prefix
|
@@ -22,7 +22,7 @@ module Jekyll
|
|
22
22
|
#
|
23
23
|
# Returns the String suffix.
|
24
24
|
def self.highlighter_suffix(highlighter_suffix = nil)
|
25
|
-
|
25
|
+
unless defined?(@highlighter_suffix) && highlighter_suffix.nil?
|
26
26
|
@highlighter_suffix = highlighter_suffix
|
27
27
|
end
|
28
28
|
@highlighter_suffix
|
data/lib/jekyll/convertible.rb
CHANGED
@@ -48,8 +48,10 @@ module Jekyll
|
|
48
48
|
end
|
49
49
|
rescue SyntaxError => e
|
50
50
|
Jekyll.logger.warn "YAML Exception reading #{filename}: #{e.message}"
|
51
|
+
raise e if self.site.config["strict_front_matter"]
|
51
52
|
rescue => e
|
52
53
|
Jekyll.logger.warn "Error reading file #{filename}: #{e.message}"
|
54
|
+
raise e if self.site.config["strict_front_matter"]
|
53
55
|
end
|
54
56
|
|
55
57
|
self.data ||= {}
|
@@ -69,7 +71,7 @@ module Jekyll
|
|
69
71
|
end
|
70
72
|
|
71
73
|
def validate_permalink!(filename)
|
72
|
-
if self.data["permalink"] && self.data["permalink"].empty?
|
74
|
+
if self.data["permalink"] && self.data["permalink"].to_s.empty?
|
73
75
|
raise Errors::InvalidPermalinkError, "Invalid permalink in #{filename}"
|
74
76
|
end
|
75
77
|
end
|
@@ -78,7 +80,7 @@ module Jekyll
|
|
78
80
|
#
|
79
81
|
# Returns the transformed contents.
|
80
82
|
def transform
|
81
|
-
_renderer.
|
83
|
+
_renderer.convert(content)
|
82
84
|
end
|
83
85
|
|
84
86
|
# Determine the extension depending on content_type.
|
@@ -158,7 +160,7 @@ module Jekyll
|
|
158
160
|
#
|
159
161
|
# Returns true if extname == .coffee, false otherwise.
|
160
162
|
def coffeescript_file?
|
161
|
-
".coffee"
|
163
|
+
ext == ".coffee"
|
162
164
|
end
|
163
165
|
|
164
166
|
# Determine whether the file should be rendered with Liquid.
|