jekyll 3.5.2 → 3.6.0.pre.beta1
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 +4 -0
- data/README.markdown +5 -3
- data/exe/jekyll +3 -1
- data/lib/jekyll.rb +7 -4
- data/lib/jekyll/cleaner.rb +2 -0
- data/lib/jekyll/collection.rb +2 -0
- data/lib/jekyll/command.rb +2 -0
- data/lib/jekyll/commands/build.rb +2 -0
- data/lib/jekyll/commands/clean.rb +2 -0
- data/lib/jekyll/commands/doctor.rb +37 -0
- data/lib/jekyll/commands/help.rb +2 -0
- data/lib/jekyll/commands/new.rb +5 -3
- data/lib/jekyll/commands/new_theme.rb +2 -0
- data/lib/jekyll/commands/serve.rb +3 -1
- data/lib/jekyll/commands/serve/servlet.rb +3 -1
- data/lib/jekyll/configuration.rb +2 -1
- data/lib/jekyll/converter.rb +2 -0
- data/lib/jekyll/converters/identity.rb +2 -0
- data/lib/jekyll/converters/markdown.rb +2 -0
- data/lib/jekyll/converters/markdown/rdiscount_parser.rb +2 -0
- data/lib/jekyll/converters/markdown/redcarpet_parser.rb +4 -4
- data/lib/jekyll/converters/smartypants.rb +2 -0
- data/lib/jekyll/convertible.rb +1 -0
- data/lib/jekyll/deprecator.rb +3 -2
- data/lib/jekyll/document.rb +1 -0
- data/lib/jekyll/drops/collection_drop.rb +1 -0
- data/lib/jekyll/drops/document_drop.rb +1 -0
- data/lib/jekyll/drops/drop.rb +1 -0
- data/lib/jekyll/drops/excerpt_drop.rb +1 -0
- data/lib/jekyll/drops/jekyll_drop.rb +1 -0
- data/lib/jekyll/drops/site_drop.rb +4 -0
- data/lib/jekyll/drops/static_file_drop.rb +2 -0
- data/lib/jekyll/drops/unified_payload_drop.rb +1 -0
- data/lib/jekyll/drops/url_drop.rb +1 -0
- data/lib/jekyll/entry_filter.rb +2 -0
- data/lib/jekyll/errors.rb +2 -0
- data/lib/jekyll/excerpt.rb +3 -1
- data/lib/jekyll/external.rb +2 -0
- data/lib/jekyll/filters.rb +2 -0
- data/lib/jekyll/filters/grouping_filters.rb +2 -0
- data/lib/jekyll/filters/url_filters.rb +3 -1
- data/lib/jekyll/frontmatter_defaults.rb +2 -0
- data/lib/jekyll/generator.rb +2 -0
- data/lib/jekyll/hooks.rb +2 -0
- data/lib/jekyll/layout.rb +2 -0
- data/lib/jekyll/liquid_extensions.rb +2 -0
- data/lib/jekyll/liquid_renderer.rb +2 -3
- data/lib/jekyll/liquid_renderer/file.rb +2 -0
- data/lib/jekyll/liquid_renderer/table.rb +5 -3
- data/lib/jekyll/log_adapter.rb +49 -17
- data/lib/jekyll/page.rb +2 -0
- data/lib/jekyll/plugin.rb +2 -0
- data/lib/jekyll/plugin_manager.rb +2 -0
- data/lib/jekyll/publisher.rb +2 -0
- data/lib/jekyll/reader.rb +1 -0
- data/lib/jekyll/readers/collection_reader.rb +2 -0
- data/lib/jekyll/readers/data_reader.rb +4 -2
- data/lib/jekyll/readers/layout_reader.rb +2 -0
- data/lib/jekyll/readers/page_reader.rb +2 -0
- data/lib/jekyll/readers/post_reader.rb +2 -0
- data/lib/jekyll/readers/static_file_reader.rb +2 -0
- data/lib/jekyll/readers/theme_assets_reader.rb +2 -0
- data/lib/jekyll/regenerator.rb +2 -0
- data/lib/jekyll/related_posts.rb +2 -0
- data/lib/jekyll/renderer.rb +1 -0
- data/lib/jekyll/site.rb +3 -4
- data/lib/jekyll/static_file.rb +2 -0
- data/lib/jekyll/stevenson.rb +2 -0
- data/lib/jekyll/tags/highlight.rb +7 -3
- data/lib/jekyll/tags/include.rb +12 -3
- data/lib/jekyll/tags/link.rb +2 -0
- data/lib/jekyll/tags/post_url.rb +2 -0
- data/lib/jekyll/theme.rb +2 -0
- data/lib/jekyll/theme_builder.rb +2 -0
- data/lib/jekyll/url.rb +3 -1
- data/lib/jekyll/utils.rb +7 -1
- data/lib/jekyll/utils/exec.rb +2 -0
- data/lib/jekyll/utils/platforms.rb +2 -0
- data/lib/jekyll/utils/rouge.rb +21 -0
- data/lib/jekyll/utils/win_tz.rb +2 -0
- data/lib/jekyll/version.rb +3 -1
- data/lib/site_template/_config.yml +1 -1
- data/lib/theme_template/Gemfile +2 -0
- data/lib/theme_template/README.md.erb +7 -3
- metadata +16 -9
data/lib/jekyll/entry_filter.rb
CHANGED
data/lib/jekyll/errors.rb
CHANGED
data/lib/jekyll/excerpt.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Jekyll
|
2
4
|
class Excerpt
|
3
5
|
extend Forwardable
|
@@ -117,7 +119,7 @@ module Jekyll
|
|
117
119
|
if tail.empty?
|
118
120
|
head
|
119
121
|
else
|
120
|
-
|
122
|
+
head.to_s.dup << "\n\n" << tail.scan(%r!^ {0,3}\[[^\]]+\]:.+$!).join("\n")
|
121
123
|
end
|
122
124
|
end
|
123
125
|
end
|
data/lib/jekyll/external.rb
CHANGED
data/lib/jekyll/filters.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "addressable/uri"
|
2
4
|
|
3
5
|
module Jekyll
|
@@ -12,7 +14,7 @@ module Jekyll
|
|
12
14
|
return if input.nil?
|
13
15
|
return input if Addressable::URI.parse(input.to_s).absolute?
|
14
16
|
site = @context.registers[:site]
|
15
|
-
return relative_url(input)
|
17
|
+
return relative_url(input) if site.config["url"].nil?
|
16
18
|
Addressable::URI.parse(
|
17
19
|
site.config["url"].to_s + relative_url(input)
|
18
20
|
).normalize.to_s
|
data/lib/jekyll/generator.rb
CHANGED
data/lib/jekyll/hooks.rb
CHANGED
data/lib/jekyll/layout.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "jekyll/liquid_renderer/file"
|
2
4
|
require "jekyll/liquid_renderer/table"
|
3
5
|
|
@@ -41,9 +43,6 @@ module Jekyll
|
|
41
43
|
end
|
42
44
|
|
43
45
|
def self.format_error(e, path)
|
44
|
-
if e.is_a? Tags::IncludeTagError
|
45
|
-
return "#{e.message} in #{e.path}, included in #{path}"
|
46
|
-
end
|
47
46
|
"#{e.message} in #{path}"
|
48
47
|
end
|
49
48
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Jekyll
|
2
4
|
class LiquidRenderer::Table
|
3
5
|
def initialize(stats)
|
@@ -13,7 +15,7 @@ module Jekyll
|
|
13
15
|
private
|
14
16
|
|
15
17
|
def generate_table(data, widths)
|
16
|
-
str = "\n"
|
18
|
+
str = String.new("\n")
|
17
19
|
|
18
20
|
table_head = data.shift
|
19
21
|
str << generate_row(table_head, widths)
|
@@ -28,7 +30,7 @@ module Jekyll
|
|
28
30
|
end
|
29
31
|
|
30
32
|
def generate_table_head_border(row_data, widths)
|
31
|
-
str = ""
|
33
|
+
str = String.new("")
|
32
34
|
|
33
35
|
row_data.each_index do |cell_index|
|
34
36
|
str << "-" * widths[cell_index]
|
@@ -40,7 +42,7 @@ module Jekyll
|
|
40
42
|
end
|
41
43
|
|
42
44
|
def generate_row(row_data, widths)
|
43
|
-
str = ""
|
45
|
+
str = String.new("")
|
44
46
|
|
45
47
|
row_data.each_with_index do |cell_data, cell_index|
|
46
48
|
str << if cell_index.zero?
|
data/lib/jekyll/log_adapter.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Jekyll
|
2
4
|
class LogAdapter
|
3
|
-
attr_reader :writer, :messages
|
5
|
+
attr_reader :writer, :messages, :level
|
4
6
|
|
5
7
|
LOG_LEVELS = {
|
6
8
|
:debug => ::Logger::DEBUG,
|
@@ -28,6 +30,7 @@ module Jekyll
|
|
28
30
|
# Returns nothing
|
29
31
|
def log_level=(level)
|
30
32
|
writer.level = LOG_LEVELS.fetch(level)
|
33
|
+
@level = level
|
31
34
|
end
|
32
35
|
|
33
36
|
def adjust_verbosity(options = {})
|
@@ -46,8 +49,8 @@ module Jekyll
|
|
46
49
|
# message - the message detail
|
47
50
|
#
|
48
51
|
# Returns nothing
|
49
|
-
def debug(topic, message = nil)
|
50
|
-
|
52
|
+
def debug(topic, message = nil, &block)
|
53
|
+
write(:debug, topic, message, &block)
|
51
54
|
end
|
52
55
|
|
53
56
|
# Public: Print a message
|
@@ -56,8 +59,8 @@ module Jekyll
|
|
56
59
|
# message - the message detail
|
57
60
|
#
|
58
61
|
# Returns nothing
|
59
|
-
def info(topic, message = nil)
|
60
|
-
|
62
|
+
def info(topic, message = nil, &block)
|
63
|
+
write(:info, topic, message, &block)
|
61
64
|
end
|
62
65
|
|
63
66
|
# Public: Print a message
|
@@ -66,8 +69,8 @@ module Jekyll
|
|
66
69
|
# message - the message detail
|
67
70
|
#
|
68
71
|
# Returns nothing
|
69
|
-
def warn(topic, message = nil)
|
70
|
-
|
72
|
+
def warn(topic, message = nil, &block)
|
73
|
+
write(:warn, topic, message, &block)
|
71
74
|
end
|
72
75
|
|
73
76
|
# Public: Print an error message
|
@@ -76,8 +79,8 @@ module Jekyll
|
|
76
79
|
# message - the message detail
|
77
80
|
#
|
78
81
|
# Returns nothing
|
79
|
-
def error(topic, message = nil)
|
80
|
-
|
82
|
+
def error(topic, message = nil, &block)
|
83
|
+
write(:error, topic, message, &block)
|
81
84
|
end
|
82
85
|
|
83
86
|
# Public: Print an error message and immediately abort the process
|
@@ -86,8 +89,8 @@ module Jekyll
|
|
86
89
|
# message - the message detail (can be omitted)
|
87
90
|
#
|
88
91
|
# Returns nothing
|
89
|
-
def abort_with(topic, message = nil)
|
90
|
-
error(topic, message)
|
92
|
+
def abort_with(topic, message = nil, &block)
|
93
|
+
error(topic, message, &block)
|
91
94
|
abort
|
92
95
|
end
|
93
96
|
|
@@ -97,19 +100,48 @@ module Jekyll
|
|
97
100
|
# message - the message detail
|
98
101
|
#
|
99
102
|
# Returns the formatted message
|
100
|
-
def message(topic, message)
|
101
|
-
|
102
|
-
|
103
|
-
|
103
|
+
def message(topic, message = nil)
|
104
|
+
raise ArgumentError, "block or message, not both" if block_given? && message
|
105
|
+
|
106
|
+
message = yield if block_given?
|
107
|
+
message = message.to_s.gsub(%r!\s+!, " ")
|
108
|
+
topic = formatted_topic(topic, block_given?)
|
109
|
+
out = topic + message
|
110
|
+
messages << out
|
111
|
+
out
|
104
112
|
end
|
105
113
|
|
106
114
|
# Internal: Format the topic
|
107
115
|
#
|
108
116
|
# topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc.
|
117
|
+
# colon -
|
109
118
|
#
|
110
119
|
# Returns the formatted topic statement
|
111
|
-
def formatted_topic(topic)
|
112
|
-
"#{topic} ".rjust(20)
|
120
|
+
def formatted_topic(topic, colon = false)
|
121
|
+
"#{topic}#{colon ? ": " : " "}".rjust(20)
|
122
|
+
end
|
123
|
+
|
124
|
+
# Internal: Check if the message should be written given the log level.
|
125
|
+
#
|
126
|
+
# level_of_message - the Symbol level of message, one of :debug, :info, :warn, :error
|
127
|
+
#
|
128
|
+
# Returns whether the message should be written.
|
129
|
+
def write_message?(level_of_message)
|
130
|
+
LOG_LEVELS.fetch(level) <= LOG_LEVELS.fetch(level_of_message)
|
131
|
+
end
|
132
|
+
|
133
|
+
# Internal: Log a message.
|
134
|
+
#
|
135
|
+
# level_of_message - the Symbol level of message, one of :debug, :info, :warn, :error
|
136
|
+
# topic - the String topic or full message
|
137
|
+
# message - the String message (optional)
|
138
|
+
# block - a block containing the message (optional)
|
139
|
+
#
|
140
|
+
# Returns false if the message was not written, otherwise returns the value of calling
|
141
|
+
# the appropriate writer method, e.g. writer.info.
|
142
|
+
def write(level_of_message, topic, message = nil, &block)
|
143
|
+
return false unless write_message?(level_of_message)
|
144
|
+
writer.public_send(level_of_message, message(topic, message, &block))
|
113
145
|
end
|
114
146
|
end
|
115
147
|
end
|
data/lib/jekyll/page.rb
CHANGED
data/lib/jekyll/plugin.rb
CHANGED
data/lib/jekyll/publisher.rb
CHANGED
data/lib/jekyll/reader.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Jekyll
|
2
4
|
class DataReader
|
3
5
|
attr_reader :site, :content
|
@@ -68,8 +70,8 @@ module Jekyll
|
|
68
70
|
end
|
69
71
|
|
70
72
|
def sanitize_filename(name)
|
71
|
-
name.gsub
|
72
|
-
|
73
|
+
name.gsub(%r![^\w\s-]+|(?<=^|\b\s)\s+(?=$|\s?\b)!, "")
|
74
|
+
.gsub(%r!\s+!, "_")
|
73
75
|
end
|
74
76
|
end
|
75
77
|
end
|
data/lib/jekyll/regenerator.rb
CHANGED
data/lib/jekyll/related_posts.rb
CHANGED
data/lib/jekyll/renderer.rb
CHANGED
data/lib/jekyll/site.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# encoding: UTF-8
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require "csv"
|
4
5
|
|
@@ -73,13 +74,11 @@ module Jekyll
|
|
73
74
|
render
|
74
75
|
cleanup
|
75
76
|
write
|
76
|
-
print_stats
|
77
|
+
print_stats if config["profile"]
|
77
78
|
end
|
78
79
|
|
79
80
|
def print_stats
|
80
|
-
|
81
|
-
puts @liquid_renderer.stats_table
|
82
|
-
end
|
81
|
+
puts @liquid_renderer.stats_table
|
83
82
|
end
|
84
83
|
|
85
84
|
# Reset Site details.
|
data/lib/jekyll/static_file.rb
CHANGED
data/lib/jekyll/stevenson.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Jekyll
|
2
4
|
module Tags
|
3
5
|
class HighlightBlock < Liquid::Block
|
@@ -109,10 +111,12 @@ eos
|
|
109
111
|
end
|
110
112
|
|
111
113
|
def render_rouge(code)
|
112
|
-
Jekyll::
|
113
|
-
formatter = Rouge::Formatters::HTML.new(
|
114
|
+
formatter = Jekyll::Utils::Rouge.html_formatter(
|
114
115
|
:line_numbers => @highlight_options[:linenos],
|
115
|
-
:wrap => false
|
116
|
+
:wrap => false,
|
117
|
+
:css_class => "highlight",
|
118
|
+
:gutter_class => "gutter",
|
119
|
+
:code_class => "code"
|
116
120
|
)
|
117
121
|
lexer = Rouge::Lexer.find_fancy(@lang, code) || Rouge::Lexers::PlainText
|
118
122
|
formatter.format(lexer.lex(code))
|