jekyll 3.9.1 → 4.0.0.pre.alpha1

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 (94) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +27 -50
  3. data/LICENSE +1 -1
  4. data/README.markdown +46 -17
  5. data/lib/blank_template/_config.yml +3 -0
  6. data/lib/blank_template/_layouts/default.html +12 -0
  7. data/lib/blank_template/_sass/main.scss +9 -0
  8. data/lib/blank_template/assets/css/main.scss +4 -0
  9. data/lib/blank_template/index.md +8 -0
  10. data/lib/jekyll.rb +5 -0
  11. data/lib/jekyll/cache.rb +183 -0
  12. data/lib/jekyll/cleaner.rb +2 -1
  13. data/lib/jekyll/collection.rb +78 -8
  14. data/lib/jekyll/command.rb +31 -6
  15. data/lib/jekyll/commands/build.rb +11 -20
  16. data/lib/jekyll/commands/clean.rb +2 -0
  17. data/lib/jekyll/commands/doctor.rb +15 -8
  18. data/lib/jekyll/commands/help.rb +1 -1
  19. data/lib/jekyll/commands/new.rb +37 -39
  20. data/lib/jekyll/commands/new_theme.rb +30 -28
  21. data/lib/jekyll/commands/serve.rb +46 -80
  22. data/lib/jekyll/commands/serve/live_reload_reactor.rb +6 -10
  23. data/lib/jekyll/commands/serve/servlet.rb +9 -11
  24. data/lib/jekyll/configuration.rb +26 -26
  25. data/lib/jekyll/converters/identity.rb +18 -0
  26. data/lib/jekyll/converters/markdown.rb +49 -40
  27. data/lib/jekyll/converters/markdown/kramdown_parser.rb +1 -10
  28. data/lib/jekyll/converters/smartypants.rb +34 -14
  29. data/lib/jekyll/convertible.rb +11 -13
  30. data/lib/jekyll/deprecator.rb +1 -3
  31. data/lib/jekyll/document.rb +44 -41
  32. data/lib/jekyll/drops/collection_drop.rb +2 -3
  33. data/lib/jekyll/drops/document_drop.rb +2 -1
  34. data/lib/jekyll/drops/drop.rb +3 -6
  35. data/lib/jekyll/drops/excerpt_drop.rb +4 -0
  36. data/lib/jekyll/drops/site_drop.rb +4 -13
  37. data/lib/jekyll/drops/unified_payload_drop.rb +1 -0
  38. data/lib/jekyll/drops/url_drop.rb +1 -0
  39. data/lib/jekyll/entry_filter.rb +2 -1
  40. data/lib/jekyll/excerpt.rb +45 -34
  41. data/lib/jekyll/external.rb +10 -5
  42. data/lib/jekyll/filters.rb +72 -31
  43. data/lib/jekyll/filters/date_filters.rb +6 -3
  44. data/lib/jekyll/filters/grouping_filters.rb +1 -2
  45. data/lib/jekyll/filters/url_filters.rb +6 -1
  46. data/lib/jekyll/frontmatter_defaults.rb +35 -19
  47. data/lib/jekyll/hooks.rb +2 -3
  48. data/lib/jekyll/liquid_extensions.rb +0 -2
  49. data/lib/jekyll/liquid_renderer.rb +13 -1
  50. data/lib/jekyll/liquid_renderer/file.rb +14 -3
  51. data/lib/jekyll/liquid_renderer/table.rb +67 -65
  52. data/lib/jekyll/log_adapter.rb +5 -1
  53. data/lib/jekyll/page.rb +10 -11
  54. data/lib/jekyll/page_without_a_file.rb +0 -4
  55. data/lib/jekyll/plugin.rb +5 -11
  56. data/lib/jekyll/plugin_manager.rb +2 -0
  57. data/lib/jekyll/reader.rb +38 -8
  58. data/lib/jekyll/readers/data_reader.rb +7 -9
  59. data/lib/jekyll/readers/layout_reader.rb +2 -12
  60. data/lib/jekyll/readers/post_reader.rb +29 -17
  61. data/lib/jekyll/readers/static_file_reader.rb +1 -1
  62. data/lib/jekyll/readers/theme_assets_reader.rb +7 -5
  63. data/lib/jekyll/regenerator.rb +4 -12
  64. data/lib/jekyll/renderer.rb +14 -25
  65. data/lib/jekyll/site.rb +78 -34
  66. data/lib/jekyll/static_file.rb +47 -11
  67. data/lib/jekyll/stevenson.rb +2 -3
  68. data/lib/jekyll/tags/highlight.rb +22 -52
  69. data/lib/jekyll/tags/include.rb +22 -38
  70. data/lib/jekyll/tags/link.rb +11 -7
  71. data/lib/jekyll/tags/post_url.rb +17 -16
  72. data/lib/jekyll/theme.rb +12 -23
  73. data/lib/jekyll/theme_builder.rb +91 -89
  74. data/lib/jekyll/url.rb +3 -2
  75. data/lib/jekyll/utils.rb +5 -4
  76. data/lib/jekyll/utils/ansi.rb +1 -1
  77. data/lib/jekyll/utils/exec.rb +0 -1
  78. data/lib/jekyll/utils/internet.rb +2 -4
  79. data/lib/jekyll/utils/platforms.rb +8 -8
  80. data/lib/jekyll/utils/thread_event.rb +1 -5
  81. data/lib/jekyll/utils/win_tz.rb +1 -1
  82. data/lib/jekyll/version.rb +1 -1
  83. data/lib/site_template/.gitignore +2 -0
  84. data/lib/site_template/404.html +1 -0
  85. data/lib/site_template/_config.yml +17 -5
  86. data/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +5 -1
  87. data/lib/site_template/{about.md → about.markdown} +0 -0
  88. data/lib/site_template/{index.md → index.markdown} +0 -0
  89. data/lib/theme_template/gitignore.erb +1 -0
  90. data/rubocop/jekyll/assert_equal_literal_actual.rb +149 -0
  91. metadata +85 -51
  92. data/lib/jekyll/converters/markdown/rdiscount_parser.rb +0 -37
  93. data/lib/jekyll/converters/markdown/redcarpet_parser.rb +0 -112
  94. data/lib/jekyll/utils/rouge.rb +0 -22
@@ -6,7 +6,11 @@ categories: jekyll update
6
6
  ---
7
7
  You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
8
8
 
9
- To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.
9
+ Jekyll requires blog post files to be named according to the following format:
10
+
11
+ `YEAR-MONTH-DAY-title.MARKUP`
12
+
13
+ Where `YEAR` is a four-digit number, `MONTH` and `DAY` are both two-digit numbers, and `MARKUP` is the file extension representing the format used in the file. After that, include the necessary front matter. Take a look at the source for this post to get an idea about how it works.
10
14
 
11
15
  Jekyll also offers powerful support for code snippets:
12
16
 
File without changes
File without changes
@@ -1,5 +1,6 @@
1
1
  *.gem
2
2
  .bundle
3
+ .jekyll-cache
3
4
  .sass-cache
4
5
  _site
5
6
  Gemfile.lock
@@ -0,0 +1,149 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module Jekyll
6
+ # Checks for `assert_equal(exp, act, msg = nil)` calls containing literal values as
7
+ # second argument. The second argument should ideally be a method called on the tested
8
+ # instance.
9
+ #
10
+ # @example
11
+ # # bad
12
+ # assert_equal @foo.bar, "foobar"
13
+ # assert_equal @alpha.beta, { "foo" => "bar", "lorem" => "ipsum" }
14
+ # assert_equal @alpha.omega, ["foobar", "lipsum"]
15
+ #
16
+ # # good
17
+ # assert_equal "foobar", @foo.bar
18
+ #
19
+ # assert_equal(
20
+ # { "foo" => "bar", "lorem" => "ipsum" },
21
+ # @alpha.beta
22
+ # )
23
+ #
24
+ # assert_equal(
25
+ # ["foobar", "lipsum"],
26
+ # @alpha.omega
27
+ # )
28
+ #
29
+ class AssertEqualLiteralActual < Cop
30
+ MSG = "Provide the 'expected value' as the first argument to `assert_equal`.".freeze
31
+
32
+ SIMPLE_LITERALS = %i(
33
+ true
34
+ false
35
+ nil
36
+ int
37
+ float
38
+ str
39
+ sym
40
+ complex
41
+ rational
42
+ regopt
43
+ ).freeze
44
+
45
+ COMPLEX_LITERALS = %i(
46
+ array
47
+ hash
48
+ pair
49
+ irange
50
+ erange
51
+ regexp
52
+ ).freeze
53
+
54
+ def_node_matcher :literal_actual?, <<-PATTERN
55
+ (send nil? :assert_equal $(send ...) $#literal?)
56
+ PATTERN
57
+
58
+ def_node_matcher :literal_actual_with_msg?, <<-PATTERN
59
+ (send nil? :assert_equal $(send ...) $#literal? $#opt_msg?)
60
+ PATTERN
61
+
62
+ def on_send(node)
63
+ return unless literal_actual?(node) || literal_actual_with_msg?(node)
64
+ add_offense(node, location: :expression)
65
+ end
66
+
67
+ def autocorrect(node)
68
+ lambda do |corrector|
69
+ corrector.replace(node.loc.expression, replacement(node))
70
+ end
71
+ end
72
+
73
+ private
74
+
75
+ def opt_msg?(node)
76
+ node&.source
77
+ end
78
+
79
+ # This is not implement using a NodePattern because it seems
80
+ # to not be able to match against an explicit (nil) sexp
81
+ def literal?(node)
82
+ node && (simple_literal?(node) || complex_literal?(node))
83
+ end
84
+
85
+ def simple_literal?(node)
86
+ SIMPLE_LITERALS.include?(node.type)
87
+ end
88
+
89
+ def complex_literal?(node)
90
+ COMPLEX_LITERALS.include?(node.type) &&
91
+ node.each_child_node.all?(&method(:literal?))
92
+ end
93
+
94
+ def replacement(node)
95
+ _, _, first_param, second_param, optional_param = *node
96
+
97
+ replaced_text = \
98
+ if second_param.type == :hash
99
+ replace_hash_with_variable(first_param.source, second_param.source)
100
+ elsif second_param.type == :array && second_param.source != "[]"
101
+ replace_array_with_variable(first_param.source, second_param.source)
102
+ else
103
+ replace_based_on_line_length(first_param.source, second_param.source)
104
+ end
105
+
106
+ return "#{replaced_text}, #{optional_param.source}" if optional_param
107
+ replaced_text
108
+ end
109
+
110
+ def replace_based_on_line_length(first_expression, second_expression)
111
+ result = "assert_equal #{second_expression}, #{first_expression}"
112
+ return result if result.length < 80
113
+
114
+ # fold long lines independent of Rubocop configuration for better readability
115
+ <<~TEXT
116
+ assert_equal(
117
+ #{second_expression},
118
+ #{first_expression}
119
+ )
120
+ TEXT
121
+ end
122
+
123
+ def replace_hash_with_variable(first_expression, second_expression)
124
+ expect_expression = if second_expression.start_with?("{")
125
+ second_expression
126
+ else
127
+ "{#{second_expression}}"
128
+ end
129
+ <<~TEXT
130
+ expected = #{expect_expression}
131
+ assert_equal expected, #{first_expression}
132
+ TEXT
133
+ end
134
+
135
+ def replace_array_with_variable(first_expression, second_expression)
136
+ expect_expression = if second_expression.start_with?("%")
137
+ second_expression
138
+ else
139
+ Array(second_expression)
140
+ end
141
+ <<~TEXT
142
+ expected = #{expect_expression}
143
+ assert_equal expected, #{first_expression}
144
+ TEXT
145
+ end
146
+ end
147
+ end
148
+ end
149
+ end
metadata CHANGED
@@ -1,14 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.1
4
+ version: 4.0.0.pre.alpha1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
8
- autorequire:
8
+ - Parker Moore
9
+ - Matt Rogers
10
+ autorequire:
9
11
  bindir: exe
10
12
  cert_chain: []
11
- date: 2021-04-08 00:00:00.000000000 Z
13
+ date: 2019-03-19 00:00:00.000000000 Z
12
14
  dependencies:
13
15
  - !ruby/object:Gem::Dependency
14
16
  name: addressable
@@ -56,16 +58,22 @@ dependencies:
56
58
  name: i18n
57
59
  requirement: !ruby/object:Gem::Requirement
58
60
  requirements:
59
- - - "~>"
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: 0.9.5
64
+ - - "<"
60
65
  - !ruby/object:Gem::Version
61
- version: '0.7'
66
+ version: '2'
62
67
  type: :runtime
63
68
  prerelease: false
64
69
  version_requirements: !ruby/object:Gem::Requirement
65
70
  requirements:
66
- - - "~>"
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: 0.9.5
74
+ - - "<"
67
75
  - !ruby/object:Gem::Version
68
- version: '0.7'
76
+ version: '2'
69
77
  - !ruby/object:Gem::Dependency
70
78
  name: jekyll-sass-converter
71
79
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +102,34 @@ dependencies:
94
102
  - - "~>"
95
103
  - !ruby/object:Gem::Version
96
104
  version: '2.0'
105
+ - !ruby/object:Gem::Dependency
106
+ name: kramdown
107
+ requirement: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '2.1'
112
+ type: :runtime
113
+ prerelease: false
114
+ version_requirements: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - "~>"
117
+ - !ruby/object:Gem::Version
118
+ version: '2.1'
119
+ - !ruby/object:Gem::Dependency
120
+ name: kramdown-parser-gfm
121
+ requirement: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - "~>"
124
+ - !ruby/object:Gem::Version
125
+ version: '1.0'
126
+ type: :runtime
127
+ prerelease: false
128
+ version_requirements: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - "~>"
131
+ - !ruby/object:Gem::Version
132
+ version: '1.0'
97
133
  - !ruby/object:Gem::Dependency
98
134
  name: liquid
99
135
  requirement: !ruby/object:Gem::Requirement
@@ -140,22 +176,16 @@ dependencies:
140
176
  name: rouge
141
177
  requirement: !ruby/object:Gem::Requirement
142
178
  requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '1.7'
146
- - - "<"
179
+ - - "~>"
147
180
  - !ruby/object:Gem::Version
148
- version: '4'
181
+ version: '3.0'
149
182
  type: :runtime
150
183
  prerelease: false
151
184
  version_requirements: !ruby/object:Gem::Requirement
152
185
  requirements:
153
- - - ">="
154
- - !ruby/object:Gem::Version
155
- version: '1.7'
156
- - - "<"
186
+ - - "~>"
157
187
  - !ruby/object:Gem::Version
158
- version: '4'
188
+ version: '3.0'
159
189
  - !ruby/object:Gem::Dependency
160
190
  name: safe_yaml
161
191
  requirement: !ruby/object:Gem::Requirement
@@ -170,28 +200,9 @@ dependencies:
170
200
  - - "~>"
171
201
  - !ruby/object:Gem::Version
172
202
  version: '1.0'
173
- - !ruby/object:Gem::Dependency
174
- name: kramdown
175
- requirement: !ruby/object:Gem::Requirement
176
- requirements:
177
- - - ">="
178
- - !ruby/object:Gem::Version
179
- version: '1.17'
180
- - - "<"
181
- - !ruby/object:Gem::Version
182
- version: '3'
183
- type: :runtime
184
- prerelease: false
185
- version_requirements: !ruby/object:Gem::Requirement
186
- requirements:
187
- - - ">="
188
- - !ruby/object:Gem::Version
189
- version: '1.17'
190
- - - "<"
191
- - !ruby/object:Gem::Version
192
- version: '3'
193
203
  description: Jekyll is a simple, blog aware, static site generator.
194
- email: tom@mojombo.com
204
+ email:
205
+ - maintainers@jekyllrb.com
195
206
  executables:
196
207
  - jekyll
197
208
  extensions: []
@@ -203,7 +214,13 @@ files:
203
214
  - LICENSE
204
215
  - README.markdown
205
216
  - exe/jekyll
217
+ - lib/blank_template/_config.yml
218
+ - lib/blank_template/_layouts/default.html
219
+ - lib/blank_template/_sass/main.scss
220
+ - lib/blank_template/assets/css/main.scss
221
+ - lib/blank_template/index.md
206
222
  - lib/jekyll.rb
223
+ - lib/jekyll/cache.rb
207
224
  - lib/jekyll/cleaner.rb
208
225
  - lib/jekyll/collection.rb
209
226
  - lib/jekyll/command.rb
@@ -223,8 +240,6 @@ files:
223
240
  - lib/jekyll/converters/identity.rb
224
241
  - lib/jekyll/converters/markdown.rb
225
242
  - lib/jekyll/converters/markdown/kramdown_parser.rb
226
- - lib/jekyll/converters/markdown/rdiscount_parser.rb
227
- - lib/jekyll/converters/markdown/redcarpet_parser.rb
228
243
  - lib/jekyll/converters/smartypants.rb
229
244
  - lib/jekyll/convertible.rb
230
245
  - lib/jekyll/deprecator.rb
@@ -287,7 +302,6 @@ files:
287
302
  - lib/jekyll/utils/exec.rb
288
303
  - lib/jekyll/utils/internet.rb
289
304
  - lib/jekyll/utils/platforms.rb
290
- - lib/jekyll/utils/rouge.rb
291
305
  - lib/jekyll/utils/thread_event.rb
292
306
  - lib/jekyll/utils/win_tz.rb
293
307
  - lib/jekyll/version.rb
@@ -295,8 +309,8 @@ files:
295
309
  - lib/site_template/404.html
296
310
  - lib/site_template/_config.yml
297
311
  - lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb
298
- - lib/site_template/about.md
299
- - lib/site_template/index.md
312
+ - lib/site_template/about.markdown
313
+ - lib/site_template/index.markdown
300
314
  - lib/theme_template/CODE_OF_CONDUCT.md.erb
301
315
  - lib/theme_template/Gemfile
302
316
  - lib/theme_template/LICENSE.txt.erb
@@ -311,13 +325,33 @@ files:
311
325
  - lib/theme_template/gitignore.erb
312
326
  - lib/theme_template/theme.gemspec.erb
313
327
  - rubocop/jekyll.rb
328
+ - rubocop/jekyll/assert_equal_literal_actual.rb
314
329
  - rubocop/jekyll/no_p_allowed.rb
315
330
  - rubocop/jekyll/no_puts_allowed.rb
316
- homepage: https://github.com/jekyll/jekyll
331
+ homepage: https://jekyllrb.com
317
332
  licenses:
318
333
  - MIT
319
- metadata: {}
320
- post_install_message:
334
+ metadata:
335
+ bug_tracker_uri: https://github.com/jekyll/jekyll/issues
336
+ changelog_uri: https://github.com/jekyll/jekyll/releases
337
+ homepage_uri: https://jekyllrb.com
338
+ source_code_uri: https://github.com/jekyll/jekyll
339
+ post_install_message: |
340
+ ----------------------------------------------------------------------------------
341
+ This version of Jekyll comes with some major changes.
342
+
343
+ Most notably:
344
+ * Our `link` tag now comes with the `relative_url` filter incorporated into it.
345
+ You should no longer prepend `{{ site.baseurl }}` to `{% link foo.md %}`
346
+ For further details: https://github.com/jekyll/jekyll/pull/6727
347
+
348
+ * Our `highlight` tag no longer parses Liquid and Liquid-like constructs in the
349
+ tag's content body. While this means you no longer need to enclose the content
350
+ within a `{% raw %}{% endraw %}` block, it also means that you can no longer
351
+ do the following as well:
352
+ `{% highlight html %}{% include snippet.html %}{% endhighlight %}`
353
+ For further details: https://github.com/jekyll/jekyll/pull/6821
354
+ ----------------------------------------------------------------------------------
321
355
  rdoc_options:
322
356
  - "--charset=UTF-8"
323
357
  require_paths:
@@ -326,15 +360,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
326
360
  requirements:
327
361
  - - ">="
328
362
  - !ruby/object:Gem::Version
329
- version: 2.1.0
363
+ version: 2.4.0
330
364
  required_rubygems_version: !ruby/object:Gem::Requirement
331
365
  requirements:
332
366
  - - ">="
333
367
  - !ruby/object:Gem::Version
334
- version: '0'
368
+ version: 2.7.0
335
369
  requirements: []
336
- rubygems_version: 3.1.6
337
- signing_key:
338
- specification_version: 2
370
+ rubygems_version: 3.0.3
371
+ signing_key:
372
+ specification_version: 4
339
373
  summary: A simple, blog aware, static site generator.
340
374
  test_files: []
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Jekyll
4
- module Converters
5
- class Markdown
6
- class RDiscountParser
7
- def initialize(config)
8
- unless defined?(RDiscount)
9
- Jekyll::External.require_with_graceful_fail "rdiscount"
10
- end
11
- @config = config
12
- @rdiscount_extensions = @config["rdiscount"]["extensions"].map(&:to_sym)
13
- end
14
-
15
- def convert(content)
16
- rd = RDiscount.new(content, *@rdiscount_extensions)
17
- html = rd.to_html
18
- if @config["rdiscount"]["toc_token"]
19
- html = replace_generated_toc(rd, html, @config["rdiscount"]["toc_token"])
20
- end
21
- html
22
- end
23
-
24
- private
25
- def replace_generated_toc(rd_instance, html, toc_token)
26
- if rd_instance.generate_toc && html.include?(toc_token)
27
- utf8_toc = rd_instance.toc_content
28
- utf8_toc.force_encoding("utf-8") if utf8_toc.respond_to?(:force_encoding)
29
- html.gsub(toc_token, utf8_toc)
30
- else
31
- html
32
- end
33
- end
34
- end
35
- end
36
- end
37
- end