jekyll 4.2.1 → 4.3.2

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.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +474 -350
  3. data/LICENSE +21 -21
  4. data/README.markdown +83 -86
  5. data/exe/jekyll +57 -57
  6. data/lib/blank_template/_config.yml +3 -3
  7. data/lib/blank_template/_layouts/default.html +12 -12
  8. data/lib/blank_template/_sass/{main.scss → base.scss} +9 -9
  9. data/lib/blank_template/assets/css/main.scss +4 -4
  10. data/lib/blank_template/index.md +8 -8
  11. data/lib/jekyll/cache.rb +186 -190
  12. data/lib/jekyll/cleaner.rb +111 -111
  13. data/lib/jekyll/collection.rb +310 -309
  14. data/lib/jekyll/command.rb +105 -105
  15. data/lib/jekyll/commands/build.rb +82 -93
  16. data/lib/jekyll/commands/clean.rb +44 -45
  17. data/lib/jekyll/commands/doctor.rb +177 -177
  18. data/lib/jekyll/commands/help.rb +34 -34
  19. data/lib/jekyll/commands/new.rb +168 -169
  20. data/lib/jekyll/commands/new_theme.rb +39 -40
  21. data/lib/jekyll/commands/serve/live_reload_reactor.rb +119 -122
  22. data/lib/jekyll/commands/serve/livereload_assets/livereload.js +1183 -1183
  23. data/lib/jekyll/commands/serve/mime_types_charset.json +71 -0
  24. data/lib/jekyll/commands/serve/servlet.rb +206 -202
  25. data/lib/jekyll/commands/serve/websockets.rb +81 -81
  26. data/lib/jekyll/commands/serve.rb +367 -362
  27. data/lib/jekyll/configuration.rb +313 -313
  28. data/lib/jekyll/converter.rb +54 -54
  29. data/lib/jekyll/converters/identity.rb +41 -41
  30. data/lib/jekyll/converters/markdown/kramdown_parser.rb +197 -199
  31. data/lib/jekyll/converters/markdown.rb +113 -113
  32. data/lib/jekyll/converters/smartypants.rb +70 -70
  33. data/lib/jekyll/convertible.rb +257 -257
  34. data/lib/jekyll/deprecator.rb +50 -50
  35. data/lib/jekyll/document.rb +543 -544
  36. data/lib/jekyll/drops/collection_drop.rb +20 -20
  37. data/lib/jekyll/drops/document_drop.rb +74 -70
  38. data/lib/jekyll/drops/drop.rb +293 -293
  39. data/lib/jekyll/drops/excerpt_drop.rb +23 -19
  40. data/lib/jekyll/drops/jekyll_drop.rb +32 -32
  41. data/lib/jekyll/drops/site_drop.rb +66 -66
  42. data/lib/jekyll/drops/static_file_drop.rb +14 -14
  43. data/lib/jekyll/drops/theme_drop.rb +36 -0
  44. data/lib/jekyll/drops/unified_payload_drop.rb +30 -26
  45. data/lib/jekyll/drops/url_drop.rb +140 -140
  46. data/lib/jekyll/entry_filter.rb +117 -121
  47. data/lib/jekyll/errors.rb +20 -20
  48. data/lib/jekyll/excerpt.rb +200 -201
  49. data/lib/jekyll/external.rb +75 -79
  50. data/lib/jekyll/filters/date_filters.rb +110 -110
  51. data/lib/jekyll/filters/grouping_filters.rb +64 -64
  52. data/lib/jekyll/filters/url_filters.rb +98 -98
  53. data/lib/jekyll/filters.rb +532 -535
  54. data/lib/jekyll/frontmatter_defaults.rb +238 -240
  55. data/lib/jekyll/generator.rb +5 -5
  56. data/lib/jekyll/hooks.rb +107 -107
  57. data/lib/jekyll/inclusion.rb +32 -32
  58. data/lib/jekyll/layout.rb +55 -67
  59. data/lib/jekyll/liquid_extensions.rb +22 -22
  60. data/lib/jekyll/liquid_renderer/file.rb +77 -77
  61. data/lib/jekyll/liquid_renderer/table.rb +45 -55
  62. data/lib/jekyll/liquid_renderer.rb +80 -80
  63. data/lib/jekyll/log_adapter.rb +151 -151
  64. data/lib/jekyll/mime.types +939 -866
  65. data/lib/jekyll/page.rb +215 -217
  66. data/lib/jekyll/page_excerpt.rb +25 -25
  67. data/lib/jekyll/page_without_a_file.rb +14 -14
  68. data/lib/jekyll/path_manager.rb +74 -74
  69. data/lib/jekyll/plugin.rb +92 -92
  70. data/lib/jekyll/plugin_manager.rb +123 -115
  71. data/lib/jekyll/profiler.rb +51 -58
  72. data/lib/jekyll/publisher.rb +23 -23
  73. data/lib/jekyll/reader.rb +209 -192
  74. data/lib/jekyll/readers/collection_reader.rb +23 -23
  75. data/lib/jekyll/readers/data_reader.rb +113 -79
  76. data/lib/jekyll/readers/layout_reader.rb +62 -62
  77. data/lib/jekyll/readers/page_reader.rb +25 -25
  78. data/lib/jekyll/readers/post_reader.rb +85 -85
  79. data/lib/jekyll/readers/static_file_reader.rb +25 -25
  80. data/lib/jekyll/readers/theme_assets_reader.rb +52 -52
  81. data/lib/jekyll/regenerator.rb +195 -195
  82. data/lib/jekyll/related_posts.rb +52 -52
  83. data/lib/jekyll/renderer.rb +263 -265
  84. data/lib/jekyll/site.rb +576 -551
  85. data/lib/jekyll/static_file.rb +205 -208
  86. data/lib/jekyll/stevenson.rb +60 -60
  87. data/lib/jekyll/tags/highlight.rb +114 -110
  88. data/lib/jekyll/tags/include.rb +275 -275
  89. data/lib/jekyll/tags/link.rb +42 -42
  90. data/lib/jekyll/tags/post_url.rb +106 -106
  91. data/lib/jekyll/theme.rb +90 -86
  92. data/lib/jekyll/theme_builder.rb +121 -121
  93. data/lib/jekyll/url.rb +167 -167
  94. data/lib/jekyll/utils/ansi.rb +57 -57
  95. data/lib/jekyll/utils/exec.rb +26 -26
  96. data/lib/jekyll/utils/internet.rb +37 -37
  97. data/lib/jekyll/utils/platforms.rb +67 -67
  98. data/lib/jekyll/utils/thread_event.rb +31 -31
  99. data/lib/jekyll/utils/win_tz.rb +46 -75
  100. data/lib/jekyll/utils.rb +371 -367
  101. data/lib/jekyll/version.rb +5 -5
  102. data/lib/jekyll.rb +195 -195
  103. data/lib/site_template/.gitignore +5 -5
  104. data/lib/site_template/404.html +25 -25
  105. data/lib/site_template/_config.yml +55 -55
  106. data/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +29 -29
  107. data/lib/site_template/about.markdown +18 -18
  108. data/lib/site_template/index.markdown +6 -6
  109. data/lib/theme_template/CODE_OF_CONDUCT.md.erb +74 -74
  110. data/lib/theme_template/Gemfile +4 -4
  111. data/lib/theme_template/LICENSE.txt.erb +21 -21
  112. data/lib/theme_template/README.md.erb +50 -52
  113. data/lib/theme_template/_layouts/default.html +1 -1
  114. data/lib/theme_template/_layouts/page.html +5 -5
  115. data/lib/theme_template/_layouts/post.html +5 -5
  116. data/lib/theme_template/example/_config.yml.erb +1 -1
  117. data/lib/theme_template/example/_post.md +12 -12
  118. data/lib/theme_template/example/index.html +14 -14
  119. data/lib/theme_template/example/style.scss +7 -7
  120. data/lib/theme_template/gitignore.erb +6 -6
  121. data/lib/theme_template/theme.gemspec.erb +16 -16
  122. data/rubocop/jekyll/assert_equal_literal_actual.rb +149 -149
  123. data/rubocop/jekyll/no_p_allowed.rb +23 -23
  124. data/rubocop/jekyll/no_puts_allowed.rb +23 -23
  125. data/rubocop/jekyll.rb +5 -5
  126. metadata +64 -18
@@ -1,20 +1,20 @@
1
- # frozen_string_literal: true
2
-
3
- module Jekyll
4
- module Drops
5
- class CollectionDrop < Drop
6
- extend Forwardable
7
-
8
- mutable false
9
-
10
- delegate_method_as :write?, :output
11
- delegate_methods :label, :docs, :files, :directory, :relative_directory
12
-
13
- private delegate_method_as :metadata, :fallback_data
14
-
15
- def to_s
16
- docs.to_s
17
- end
18
- end
19
- end
20
- end
1
+ # frozen_string_literal: true
2
+
3
+ module Jekyll
4
+ module Drops
5
+ class CollectionDrop < Drop
6
+ extend Forwardable
7
+
8
+ mutable false
9
+
10
+ delegate_method_as :write?, :output
11
+ delegate_methods :label, :docs, :files, :directory, :relative_directory
12
+
13
+ private delegate_method_as :metadata, :fallback_data
14
+
15
+ def to_s
16
+ docs.to_s
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,70 +1,74 @@
1
- # frozen_string_literal: true
2
-
3
- module Jekyll
4
- module Drops
5
- class DocumentDrop < Drop
6
- extend Forwardable
7
-
8
- NESTED_OBJECT_FIELD_BLACKLIST = %w(
9
- content output excerpt next previous
10
- ).freeze
11
-
12
- mutable false
13
-
14
- delegate_method_as :relative_path, :path
15
- private delegate_method_as :data, :fallback_data
16
-
17
- delegate_methods :id, :output, :content, :to_s, :relative_path, :url, :date
18
- data_delegators "title", "categories", "tags"
19
-
20
- def collection
21
- @obj.collection.label
22
- end
23
-
24
- def excerpt
25
- fallback_data["excerpt"].to_s
26
- end
27
-
28
- def <=>(other)
29
- return nil unless other.is_a? DocumentDrop
30
-
31
- cmp = self["date"] <=> other["date"]
32
- cmp = self["path"] <=> other["path"] if cmp.nil? || cmp.zero?
33
- cmp
34
- end
35
-
36
- def previous
37
- @obj.previous_doc.to_liquid
38
- end
39
-
40
- def next
41
- @obj.next_doc.to_liquid
42
- end
43
-
44
- # Generate a Hash for use in generating JSON.
45
- # This is useful if fields need to be cleared before the JSON can generate.
46
- #
47
- # state - the JSON::State object which determines the state of current processing.
48
- #
49
- # Returns a Hash ready for JSON generation.
50
- def hash_for_json(state = nil)
51
- to_h.tap do |hash|
52
- if state && state.depth >= 2
53
- hash["previous"] = collapse_document(hash["previous"]) if hash["previous"]
54
- hash["next"] = collapse_document(hash["next"]) if hash["next"]
55
- end
56
- end
57
- end
58
-
59
- # Generate a Hash which breaks the recursive chain.
60
- # Certain fields which are normally available are omitted.
61
- #
62
- # Returns a Hash with only non-recursive fields present.
63
- def collapse_document(doc)
64
- doc.keys.each_with_object({}) do |(key, _), result|
65
- result[key] = doc[key] unless NESTED_OBJECT_FIELD_BLACKLIST.include?(key)
66
- end
67
- end
68
- end
69
- end
70
- end
1
+ # frozen_string_literal: true
2
+
3
+ module Jekyll
4
+ module Drops
5
+ class DocumentDrop < Drop
6
+ extend Forwardable
7
+
8
+ NESTED_OBJECT_FIELD_BLACKLIST = %w(
9
+ content output excerpt next previous
10
+ ).freeze
11
+
12
+ mutable false
13
+
14
+ delegate_method_as :relative_path, :path
15
+ private delegate_method_as :data, :fallback_data
16
+
17
+ delegate_methods :id, :output, :content, :to_s, :relative_path, :url, :date
18
+ data_delegators "title", "categories", "tags"
19
+
20
+ def collection
21
+ @obj.collection.label
22
+ end
23
+
24
+ def excerpt
25
+ fallback_data["excerpt"].to_s
26
+ end
27
+
28
+ def name
29
+ fallback_data["name"] || @obj.basename
30
+ end
31
+
32
+ def <=>(other)
33
+ return nil unless other.is_a? DocumentDrop
34
+
35
+ cmp = self["date"] <=> other["date"]
36
+ cmp = self["path"] <=> other["path"] if cmp.nil? || cmp.zero?
37
+ cmp
38
+ end
39
+
40
+ def previous
41
+ @obj.previous_doc.to_liquid
42
+ end
43
+
44
+ def next
45
+ @obj.next_doc.to_liquid
46
+ end
47
+
48
+ # Generate a Hash for use in generating JSON.
49
+ # This is useful if fields need to be cleared before the JSON can generate.
50
+ #
51
+ # state - the JSON::State object which determines the state of current processing.
52
+ #
53
+ # Returns a Hash ready for JSON generation.
54
+ def hash_for_json(state = nil)
55
+ to_h.tap do |hash|
56
+ if state && state.depth >= 2
57
+ hash["previous"] = collapse_document(hash["previous"]) if hash["previous"]
58
+ hash["next"] = collapse_document(hash["next"]) if hash["next"]
59
+ end
60
+ end
61
+ end
62
+
63
+ # Generate a Hash which breaks the recursive chain.
64
+ # Certain fields which are normally available are omitted.
65
+ #
66
+ # Returns a Hash with only non-recursive fields present.
67
+ def collapse_document(doc)
68
+ doc.keys.each_with_object({}) do |(key, _), result|
69
+ result[key] = doc[key] unless NESTED_OBJECT_FIELD_BLACKLIST.include?(key)
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end