jekyll 4.0.1 → 4.2.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 +350 -163
- data/LICENSE +21 -21
- data/README.markdown +86 -90
- data/exe/jekyll +57 -57
- data/lib/blank_template/_config.yml +3 -3
- data/lib/blank_template/_layouts/default.html +12 -12
- data/lib/blank_template/_sass/main.scss +9 -9
- data/lib/blank_template/assets/css/main.scss +4 -4
- data/lib/blank_template/index.md +8 -8
- data/lib/jekyll/cache.rb +190 -190
- data/lib/jekyll/cleaner.rb +111 -111
- data/lib/jekyll/collection.rb +309 -309
- data/lib/jekyll/command.rb +105 -103
- data/lib/jekyll/commands/build.rb +93 -93
- data/lib/jekyll/commands/clean.rb +45 -45
- data/lib/jekyll/commands/doctor.rb +177 -173
- data/lib/jekyll/commands/help.rb +34 -34
- data/lib/jekyll/commands/new.rb +169 -169
- data/lib/jekyll/commands/new_theme.rb +40 -42
- data/lib/jekyll/commands/serve/live_reload_reactor.rb +122 -122
- data/lib/jekyll/commands/serve/livereload_assets/livereload.js +1183 -1183
- data/lib/jekyll/commands/serve/servlet.rb +202 -202
- data/lib/jekyll/commands/serve/websockets.rb +81 -81
- data/lib/jekyll/commands/serve.rb +362 -354
- data/lib/jekyll/configuration.rb +313 -316
- data/lib/jekyll/converter.rb +54 -54
- data/lib/jekyll/converters/identity.rb +41 -41
- data/lib/jekyll/converters/markdown/kramdown_parser.rb +199 -130
- data/lib/jekyll/converters/markdown.rb +113 -113
- data/lib/jekyll/converters/smartypants.rb +70 -70
- data/lib/jekyll/convertible.rb +257 -254
- data/lib/jekyll/deprecator.rb +50 -50
- data/lib/jekyll/document.rb +544 -522
- data/lib/jekyll/drops/collection_drop.rb +20 -20
- data/lib/jekyll/drops/document_drop.rb +70 -69
- data/lib/jekyll/drops/drop.rb +293 -215
- data/lib/jekyll/drops/excerpt_drop.rb +19 -19
- data/lib/jekyll/drops/jekyll_drop.rb +32 -32
- data/lib/jekyll/drops/site_drop.rb +66 -66
- data/lib/jekyll/drops/static_file_drop.rb +14 -14
- data/lib/jekyll/drops/unified_payload_drop.rb +26 -26
- data/lib/jekyll/drops/url_drop.rb +140 -132
- data/lib/jekyll/entry_filter.rb +121 -110
- data/lib/jekyll/errors.rb +20 -20
- data/lib/jekyll/excerpt.rb +201 -201
- data/lib/jekyll/external.rb +79 -79
- data/lib/jekyll/filters/date_filters.rb +110 -110
- data/lib/jekyll/filters/grouping_filters.rb +64 -64
- data/lib/jekyll/filters/url_filters.rb +98 -68
- data/lib/jekyll/filters.rb +535 -454
- data/lib/jekyll/frontmatter_defaults.rb +240 -245
- data/lib/jekyll/generator.rb +5 -5
- data/lib/jekyll/hooks.rb +107 -106
- data/lib/jekyll/inclusion.rb +32 -0
- data/lib/jekyll/layout.rb +67 -62
- data/lib/jekyll/liquid_extensions.rb +22 -22
- data/lib/jekyll/liquid_renderer/file.rb +77 -77
- data/lib/jekyll/liquid_renderer/table.rb +55 -75
- data/lib/jekyll/liquid_renderer.rb +80 -77
- data/lib/jekyll/log_adapter.rb +151 -151
- data/lib/jekyll/mime.types +866 -866
- data/lib/jekyll/page.rb +217 -186
- data/lib/jekyll/page_excerpt.rb +25 -0
- data/lib/jekyll/page_without_a_file.rb +14 -14
- data/lib/jekyll/path_manager.rb +74 -31
- data/lib/jekyll/plugin.rb +92 -92
- data/lib/jekyll/plugin_manager.rb +115 -115
- data/lib/jekyll/profiler.rb +58 -0
- data/lib/jekyll/publisher.rb +23 -23
- data/lib/jekyll/reader.rb +192 -187
- data/lib/jekyll/readers/collection_reader.rb +23 -22
- data/lib/jekyll/readers/data_reader.rb +79 -75
- data/lib/jekyll/readers/layout_reader.rb +62 -61
- data/lib/jekyll/readers/page_reader.rb +25 -24
- data/lib/jekyll/readers/post_reader.rb +85 -84
- data/lib/jekyll/readers/static_file_reader.rb +25 -24
- data/lib/jekyll/readers/theme_assets_reader.rb +52 -51
- data/lib/jekyll/regenerator.rb +195 -195
- data/lib/jekyll/related_posts.rb +52 -52
- data/lib/jekyll/renderer.rb +265 -267
- data/lib/jekyll/site.rb +551 -527
- data/lib/jekyll/static_file.rb +208 -203
- data/lib/jekyll/stevenson.rb +60 -60
- data/lib/jekyll/tags/highlight.rb +110 -110
- data/lib/jekyll/tags/include.rb +275 -221
- data/lib/jekyll/tags/link.rb +42 -41
- data/lib/jekyll/tags/post_url.rb +106 -107
- data/lib/jekyll/theme.rb +86 -80
- data/lib/jekyll/theme_builder.rb +121 -121
- data/lib/jekyll/url.rb +167 -164
- data/lib/jekyll/utils/ansi.rb +57 -57
- data/lib/jekyll/utils/exec.rb +26 -26
- data/lib/jekyll/utils/internet.rb +37 -37
- data/lib/jekyll/utils/platforms.rb +67 -82
- data/lib/jekyll/utils/thread_event.rb +31 -31
- data/lib/jekyll/utils/win_tz.rb +75 -75
- data/lib/jekyll/utils.rb +367 -367
- data/lib/jekyll/version.rb +5 -5
- data/lib/jekyll.rb +195 -206
- data/lib/site_template/.gitignore +5 -5
- data/lib/site_template/404.html +25 -25
- data/lib/site_template/_config.yml +55 -55
- data/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +29 -29
- data/lib/site_template/about.markdown +18 -18
- data/lib/site_template/index.markdown +6 -6
- data/lib/theme_template/CODE_OF_CONDUCT.md.erb +74 -74
- data/lib/theme_template/Gemfile +4 -4
- data/lib/theme_template/LICENSE.txt.erb +21 -21
- data/lib/theme_template/README.md.erb +52 -52
- data/lib/theme_template/_layouts/default.html +1 -1
- data/lib/theme_template/_layouts/page.html +5 -5
- data/lib/theme_template/_layouts/post.html +5 -5
- data/lib/theme_template/example/_config.yml.erb +1 -1
- data/lib/theme_template/example/_post.md +12 -12
- data/lib/theme_template/example/index.html +14 -14
- data/lib/theme_template/example/style.scss +7 -7
- data/lib/theme_template/gitignore.erb +6 -6
- data/lib/theme_template/theme.gemspec.erb +16 -19
- data/rubocop/jekyll/assert_equal_literal_actual.rb +149 -149
- data/rubocop/jekyll/no_p_allowed.rb +23 -23
- data/rubocop/jekyll/no_puts_allowed.rb +23 -23
- data/rubocop/jekyll.rb +5 -5
- metadata +20 -38
@@ -1,82 +1,67 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Jekyll
|
4
|
-
module Utils
|
5
|
-
module Platforms
|
6
|
-
extend self
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
#
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
end
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
def
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
#
|
69
|
-
|
70
|
-
private
|
71
|
-
|
72
|
-
def proc_version
|
73
|
-
@proc_version ||=
|
74
|
-
begin
|
75
|
-
File.read("/proc/version")
|
76
|
-
rescue Errno::ENOENT, Errno::EACCES
|
77
|
-
nil
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Jekyll
|
4
|
+
module Utils
|
5
|
+
module Platforms
|
6
|
+
extend self
|
7
|
+
|
8
|
+
def jruby?
|
9
|
+
RUBY_ENGINE == "jruby"
|
10
|
+
end
|
11
|
+
|
12
|
+
def mri?
|
13
|
+
RUBY_ENGINE == "ruby"
|
14
|
+
end
|
15
|
+
|
16
|
+
def windows?
|
17
|
+
vanilla_windows? || bash_on_windows?
|
18
|
+
end
|
19
|
+
|
20
|
+
# Not a Windows Subsystem for Linux (WSL)
|
21
|
+
def vanilla_windows?
|
22
|
+
rbconfig_host.match?(%r!mswin|mingw|cygwin!) && proc_version.empty?
|
23
|
+
end
|
24
|
+
alias_method :really_windows?, :vanilla_windows?
|
25
|
+
|
26
|
+
# Determine if Windows Subsystem for Linux (WSL)
|
27
|
+
def bash_on_windows?
|
28
|
+
linux_os? && microsoft_proc_version?
|
29
|
+
end
|
30
|
+
|
31
|
+
def linux?
|
32
|
+
linux_os? && !microsoft_proc_version?
|
33
|
+
end
|
34
|
+
|
35
|
+
def osx?
|
36
|
+
rbconfig_host.match?(%r!darwin|mac os!)
|
37
|
+
end
|
38
|
+
|
39
|
+
def unix?
|
40
|
+
rbconfig_host.match?(%r!solaris|bsd!)
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def proc_version
|
46
|
+
@proc_version ||= \
|
47
|
+
begin
|
48
|
+
File.read("/proc/version").downcase
|
49
|
+
rescue Errno::ENOENT, Errno::EACCES
|
50
|
+
""
|
51
|
+
end
|
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
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -1,31 +1,31 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Jekyll
|
4
|
-
module Utils
|
5
|
-
# Based on the pattern and code from
|
6
|
-
# https://emptysqua.re/blog/an-event-synchronization-primitive-for-ruby/
|
7
|
-
class ThreadEvent
|
8
|
-
attr_reader :flag
|
9
|
-
|
10
|
-
def initialize
|
11
|
-
@lock = Mutex.new
|
12
|
-
@cond = ConditionVariable.new
|
13
|
-
@flag = false
|
14
|
-
end
|
15
|
-
|
16
|
-
def set
|
17
|
-
@lock.synchronize do
|
18
|
-
yield if block_given?
|
19
|
-
@flag = true
|
20
|
-
@cond.broadcast
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def wait
|
25
|
-
@lock.synchronize do
|
26
|
-
@cond.wait(@lock) unless @flag
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Jekyll
|
4
|
+
module Utils
|
5
|
+
# Based on the pattern and code from
|
6
|
+
# https://emptysqua.re/blog/an-event-synchronization-primitive-for-ruby/
|
7
|
+
class ThreadEvent
|
8
|
+
attr_reader :flag
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
@lock = Mutex.new
|
12
|
+
@cond = ConditionVariable.new
|
13
|
+
@flag = false
|
14
|
+
end
|
15
|
+
|
16
|
+
def set
|
17
|
+
@lock.synchronize do
|
18
|
+
yield if block_given?
|
19
|
+
@flag = true
|
20
|
+
@cond.broadcast
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def wait
|
25
|
+
@lock.synchronize do
|
26
|
+
@cond.wait(@lock) unless @flag
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/jekyll/utils/win_tz.rb
CHANGED
@@ -1,75 +1,75 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Jekyll
|
4
|
-
module Utils
|
5
|
-
module WinTZ
|
6
|
-
extend self
|
7
|
-
|
8
|
-
# Public: Calculate the Timezone for Windows when the config file has a defined
|
9
|
-
# 'timezone' key.
|
10
|
-
#
|
11
|
-
# timezone - the IANA Time Zone specified in "_config.yml"
|
12
|
-
#
|
13
|
-
# Returns a string that ultimately re-defines ENV["TZ"] in Windows
|
14
|
-
def calculate(timezone)
|
15
|
-
External.require_with_graceful_fail("tzinfo") unless defined?(TZInfo)
|
16
|
-
tz = TZInfo::Timezone.get(timezone)
|
17
|
-
difference = Time.now.to_i - tz.now.to_i
|
18
|
-
#
|
19
|
-
# POSIX style definition reverses the offset sign.
|
20
|
-
# e.g. Eastern Standard Time (EST) that is 5Hrs. to the 'west' of Prime Meridian
|
21
|
-
# is denoted as:
|
22
|
-
# EST+5 (or) EST+05:00
|
23
|
-
# Reference: http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
|
24
|
-
sign = difference.negative? ? "-" : "+"
|
25
|
-
offset = sign == "-" ? "+" : "-" unless difference.zero?
|
26
|
-
#
|
27
|
-
# convert the difference (in seconds) to hours, as a rational number, and perform
|
28
|
-
# a modulo operation on it.
|
29
|
-
modulo = modulo_of(rational_hour(difference))
|
30
|
-
#
|
31
|
-
# Format the hour as a two-digit number.
|
32
|
-
# Establish the minutes based on modulo expression.
|
33
|
-
hh = format("
|
34
|
-
mm = modulo.zero? ? "00" : "30"
|
35
|
-
|
36
|
-
Jekyll.logger.debug "Timezone:", "#{timezone} #{offset}#{hh}:#{mm}"
|
37
|
-
#
|
38
|
-
# Note: The 3-letter-word below doesn't have a particular significance.
|
39
|
-
"WTZ#{sign}#{hh}:#{mm}"
|
40
|
-
end
|
41
|
-
|
42
|
-
private
|
43
|
-
|
44
|
-
# Private: Convert given seconds to an hour as a rational number.
|
45
|
-
#
|
46
|
-
# seconds - supplied as an integer, it is converted to a rational number.
|
47
|
-
# 3600 - no. of seconds in an hour.
|
48
|
-
#
|
49
|
-
# Returns a rational number.
|
50
|
-
def rational_hour(seconds)
|
51
|
-
seconds.to_r / 3600
|
52
|
-
end
|
53
|
-
|
54
|
-
# Private: Convert given seconds to an hour as an absolute number.
|
55
|
-
#
|
56
|
-
# seconds - supplied as an integer, it is converted to its absolute.
|
57
|
-
# 3600 - no. of seconds in an hour.
|
58
|
-
#
|
59
|
-
# Returns an integer.
|
60
|
-
def absolute_hour(seconds)
|
61
|
-
seconds.abs / 3600
|
62
|
-
end
|
63
|
-
|
64
|
-
# Private: Perform a modulo operation on a given fraction.
|
65
|
-
#
|
66
|
-
# fraction - supplied as a rational number, its numerator is divided
|
67
|
-
# by its denominator and the remainder returned.
|
68
|
-
#
|
69
|
-
# Returns an integer.
|
70
|
-
def modulo_of(fraction)
|
71
|
-
fraction.numerator % fraction.denominator
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Jekyll
|
4
|
+
module Utils
|
5
|
+
module WinTZ
|
6
|
+
extend self
|
7
|
+
|
8
|
+
# Public: Calculate the Timezone for Windows when the config file has a defined
|
9
|
+
# 'timezone' key.
|
10
|
+
#
|
11
|
+
# timezone - the IANA Time Zone specified in "_config.yml"
|
12
|
+
#
|
13
|
+
# Returns a string that ultimately re-defines ENV["TZ"] in Windows
|
14
|
+
def calculate(timezone)
|
15
|
+
External.require_with_graceful_fail("tzinfo") unless defined?(TZInfo)
|
16
|
+
tz = TZInfo::Timezone.get(timezone)
|
17
|
+
difference = Time.now.to_i - tz.now.to_i
|
18
|
+
#
|
19
|
+
# POSIX style definition reverses the offset sign.
|
20
|
+
# e.g. Eastern Standard Time (EST) that is 5Hrs. to the 'west' of Prime Meridian
|
21
|
+
# is denoted as:
|
22
|
+
# EST+5 (or) EST+05:00
|
23
|
+
# Reference: http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
|
24
|
+
sign = difference.negative? ? "-" : "+"
|
25
|
+
offset = sign == "-" ? "+" : "-" unless difference.zero?
|
26
|
+
#
|
27
|
+
# convert the difference (in seconds) to hours, as a rational number, and perform
|
28
|
+
# a modulo operation on it.
|
29
|
+
modulo = modulo_of(rational_hour(difference))
|
30
|
+
#
|
31
|
+
# Format the hour as a two-digit number.
|
32
|
+
# Establish the minutes based on modulo expression.
|
33
|
+
hh = format("%<hour>02d", :hour => absolute_hour(difference).ceil)
|
34
|
+
mm = modulo.zero? ? "00" : "30"
|
35
|
+
|
36
|
+
Jekyll.logger.debug "Timezone:", "#{timezone} #{offset}#{hh}:#{mm}"
|
37
|
+
#
|
38
|
+
# Note: The 3-letter-word below doesn't have a particular significance.
|
39
|
+
"WTZ#{sign}#{hh}:#{mm}"
|
40
|
+
end
|
41
|
+
|
42
|
+
private
|
43
|
+
|
44
|
+
# Private: Convert given seconds to an hour as a rational number.
|
45
|
+
#
|
46
|
+
# seconds - supplied as an integer, it is converted to a rational number.
|
47
|
+
# 3600 - no. of seconds in an hour.
|
48
|
+
#
|
49
|
+
# Returns a rational number.
|
50
|
+
def rational_hour(seconds)
|
51
|
+
seconds.to_r / 3600
|
52
|
+
end
|
53
|
+
|
54
|
+
# Private: Convert given seconds to an hour as an absolute number.
|
55
|
+
#
|
56
|
+
# seconds - supplied as an integer, it is converted to its absolute.
|
57
|
+
# 3600 - no. of seconds in an hour.
|
58
|
+
#
|
59
|
+
# Returns an integer.
|
60
|
+
def absolute_hour(seconds)
|
61
|
+
seconds.abs / 3600
|
62
|
+
end
|
63
|
+
|
64
|
+
# Private: Perform a modulo operation on a given fraction.
|
65
|
+
#
|
66
|
+
# fraction - supplied as a rational number, its numerator is divided
|
67
|
+
# by its denominator and the remainder returned.
|
68
|
+
#
|
69
|
+
# Returns an integer.
|
70
|
+
def modulo_of(fraction)
|
71
|
+
fraction.numerator % fraction.denominator
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|