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.

Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -0
  3. data/README.markdown +5 -3
  4. data/exe/jekyll +3 -1
  5. data/lib/jekyll.rb +7 -4
  6. data/lib/jekyll/cleaner.rb +2 -0
  7. data/lib/jekyll/collection.rb +2 -0
  8. data/lib/jekyll/command.rb +2 -0
  9. data/lib/jekyll/commands/build.rb +2 -0
  10. data/lib/jekyll/commands/clean.rb +2 -0
  11. data/lib/jekyll/commands/doctor.rb +37 -0
  12. data/lib/jekyll/commands/help.rb +2 -0
  13. data/lib/jekyll/commands/new.rb +5 -3
  14. data/lib/jekyll/commands/new_theme.rb +2 -0
  15. data/lib/jekyll/commands/serve.rb +3 -1
  16. data/lib/jekyll/commands/serve/servlet.rb +3 -1
  17. data/lib/jekyll/configuration.rb +2 -1
  18. data/lib/jekyll/converter.rb +2 -0
  19. data/lib/jekyll/converters/identity.rb +2 -0
  20. data/lib/jekyll/converters/markdown.rb +2 -0
  21. data/lib/jekyll/converters/markdown/rdiscount_parser.rb +2 -0
  22. data/lib/jekyll/converters/markdown/redcarpet_parser.rb +4 -4
  23. data/lib/jekyll/converters/smartypants.rb +2 -0
  24. data/lib/jekyll/convertible.rb +1 -0
  25. data/lib/jekyll/deprecator.rb +3 -2
  26. data/lib/jekyll/document.rb +1 -0
  27. data/lib/jekyll/drops/collection_drop.rb +1 -0
  28. data/lib/jekyll/drops/document_drop.rb +1 -0
  29. data/lib/jekyll/drops/drop.rb +1 -0
  30. data/lib/jekyll/drops/excerpt_drop.rb +1 -0
  31. data/lib/jekyll/drops/jekyll_drop.rb +1 -0
  32. data/lib/jekyll/drops/site_drop.rb +4 -0
  33. data/lib/jekyll/drops/static_file_drop.rb +2 -0
  34. data/lib/jekyll/drops/unified_payload_drop.rb +1 -0
  35. data/lib/jekyll/drops/url_drop.rb +1 -0
  36. data/lib/jekyll/entry_filter.rb +2 -0
  37. data/lib/jekyll/errors.rb +2 -0
  38. data/lib/jekyll/excerpt.rb +3 -1
  39. data/lib/jekyll/external.rb +2 -0
  40. data/lib/jekyll/filters.rb +2 -0
  41. data/lib/jekyll/filters/grouping_filters.rb +2 -0
  42. data/lib/jekyll/filters/url_filters.rb +3 -1
  43. data/lib/jekyll/frontmatter_defaults.rb +2 -0
  44. data/lib/jekyll/generator.rb +2 -0
  45. data/lib/jekyll/hooks.rb +2 -0
  46. data/lib/jekyll/layout.rb +2 -0
  47. data/lib/jekyll/liquid_extensions.rb +2 -0
  48. data/lib/jekyll/liquid_renderer.rb +2 -3
  49. data/lib/jekyll/liquid_renderer/file.rb +2 -0
  50. data/lib/jekyll/liquid_renderer/table.rb +5 -3
  51. data/lib/jekyll/log_adapter.rb +49 -17
  52. data/lib/jekyll/page.rb +2 -0
  53. data/lib/jekyll/plugin.rb +2 -0
  54. data/lib/jekyll/plugin_manager.rb +2 -0
  55. data/lib/jekyll/publisher.rb +2 -0
  56. data/lib/jekyll/reader.rb +1 -0
  57. data/lib/jekyll/readers/collection_reader.rb +2 -0
  58. data/lib/jekyll/readers/data_reader.rb +4 -2
  59. data/lib/jekyll/readers/layout_reader.rb +2 -0
  60. data/lib/jekyll/readers/page_reader.rb +2 -0
  61. data/lib/jekyll/readers/post_reader.rb +2 -0
  62. data/lib/jekyll/readers/static_file_reader.rb +2 -0
  63. data/lib/jekyll/readers/theme_assets_reader.rb +2 -0
  64. data/lib/jekyll/regenerator.rb +2 -0
  65. data/lib/jekyll/related_posts.rb +2 -0
  66. data/lib/jekyll/renderer.rb +1 -0
  67. data/lib/jekyll/site.rb +3 -4
  68. data/lib/jekyll/static_file.rb +2 -0
  69. data/lib/jekyll/stevenson.rb +2 -0
  70. data/lib/jekyll/tags/highlight.rb +7 -3
  71. data/lib/jekyll/tags/include.rb +12 -3
  72. data/lib/jekyll/tags/link.rb +2 -0
  73. data/lib/jekyll/tags/post_url.rb +2 -0
  74. data/lib/jekyll/theme.rb +2 -0
  75. data/lib/jekyll/theme_builder.rb +2 -0
  76. data/lib/jekyll/url.rb +3 -1
  77. data/lib/jekyll/utils.rb +7 -1
  78. data/lib/jekyll/utils/exec.rb +2 -0
  79. data/lib/jekyll/utils/platforms.rb +2 -0
  80. data/lib/jekyll/utils/rouge.rb +21 -0
  81. data/lib/jekyll/utils/win_tz.rb +2 -0
  82. data/lib/jekyll/version.rb +3 -1
  83. data/lib/site_template/_config.yml +1 -1
  84. data/lib/theme_template/Gemfile +2 -0
  85. data/lib/theme_template/README.md.erb +7 -3
  86. metadata +16 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46ce21bfe35d93f05890bde9cd6d656ba480a532
4
- data.tar.gz: c7e16c4b99b5d535cd3795b4b57a5729b692c44a
3
+ metadata.gz: d76285f73396d2606fd208d2d5312ce9e476fa58
4
+ data.tar.gz: 4322fc510b5b61eb60c0a77c19a9f64b2467b6f2
5
5
  SHA512:
6
- metadata.gz: 2e78f392ba4ac4757a7b5ccb047c72ec6f9951f816394122c898e9bdb52478e931ff16d8d4776fdfa102152a184ed1e8c8a88d954ed3b1f93417c027d34a2893
7
- data.tar.gz: '0867babd246831e8401a276adabe8200577e31eb79f037627aade98b2f838c48b946b545fd9c64cd1e2f95c29275173c2aaea5816d2967f84a3d8c77bbc6c276'
6
+ metadata.gz: 46e578f29d339fd9703380e41b59396efd324f5e6ea29e8ff0a2f2b2632bb4285c5ed81d4dc64c3b9d4669390187f41c5ae07e85803119e0d18b0443757db394
7
+ data.tar.gz: a4013df1019299b04bf63597654eb1d06305b63eaf7ab3785a6b585f2606b6d0477e902e91aea0d3f060c198655b0384bcdde9891c6b769c79c93a40f40a2a44
@@ -9,6 +9,7 @@ AllCops:
9
9
  - benchmark/**/*
10
10
  - script/**/*
11
11
  - vendor/**/*
12
+ - tmp/**/*
12
13
  Layout/AlignArray:
13
14
  Enabled: false
14
15
  Layout/AlignHash:
@@ -99,6 +100,9 @@ Style/BracesAroundHashParameters:
99
100
  Enabled: false
100
101
  Style/ClassAndModuleChildren:
101
102
  Enabled: false
103
+ Style/FrozenStringLiteralComment:
104
+ Enabled: true
105
+ EnforcedStyle: always
102
106
  Style/Documentation:
103
107
  Enabled: false
104
108
  Exclude:
@@ -22,7 +22,9 @@ Jekyll is a simple, blog-aware, static site generator perfect for personal, proj
22
22
 
23
23
  Jekyll does what you tell it to do — no more, no less. It doesn't try to outsmart users by making bold assumptions, nor does it burden them with needless complexity and configuration. Put simply, Jekyll gets out of your way and allows you to concentrate on what truly matters: your content.
24
24
 
25
- ## Having trouble with OS X/macOS?
25
+ See: https://jekyllrb.com/philosophy
26
+
27
+ ## Having trouble?
26
28
 
27
29
  See: https://jekyllrb.com/docs/troubleshooting/
28
30
 
@@ -37,13 +39,13 @@ See: https://jekyllrb.com/docs/troubleshooting/
37
39
  ## Code of Conduct
38
40
 
39
41
  In order to have a more open and welcoming community, Jekyll adheres to a
40
- [code of conduct](CONDUCT.markdown) adapted from the Ruby on Rails code of
42
+ [code of conduct](CODE_OF_CONDUCT.markdown) adapted from the Ruby on Rails code of
41
43
  conduct.
42
44
 
43
45
  Please adhere to this code of conduct in any interactions you have in the
44
46
  Jekyll community. It is strictly enforced on all official Jekyll
45
47
  repositories, websites, and resources. If you encounter someone violating
46
- these terms, please let a maintainer ([@parkr](https://github.com/parkr), [@envygeeks](https://github.com/envygeeks), [@mattr-](https://github.com/mattr-), or [@alfredxing](https://github.com/alfredxing)) know and we will address it as soon as possible.
48
+ these terms, please let a [team captain](https://github.com/orgs/jekyll/teams/affinity-team-captains/members) know and we will address it as soon as possible.
47
49
 
48
50
  ## Diving In
49
51
 
data/exe/jekyll CHANGED
@@ -1,7 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  STDOUT.sync = true
3
5
 
4
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
6
+ $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
5
7
 
6
8
  require "jekyll"
7
9
  require "mercenary"
@@ -1,4 +1,6 @@
1
- $LOAD_PATH.unshift File.dirname(__FILE__) # For use/testing when no gem is installed
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.unshift __dir__ # For use/testing when no gem is installed
2
4
 
3
5
  # Require all of the Ruby files in the given directory.
4
6
  #
@@ -6,7 +8,7 @@ $LOAD_PATH.unshift File.dirname(__FILE__) # For use/testing when no gem is insta
6
8
  #
7
9
  # Returns nothing.
8
10
  def require_all(path)
9
- glob = File.join(File.dirname(__FILE__), path, "*.rb")
11
+ glob = File.join(__dir__, path, "*.rb")
10
12
  Dir[glob].sort.each do |f|
11
13
  require f
12
14
  end
@@ -162,8 +164,9 @@ module Jekyll
162
164
  def sanitized_path(base_directory, questionable_path)
163
165
  return base_directory if base_directory.eql?(questionable_path)
164
166
 
165
- questionable_path.insert(0, "/") if questionable_path.start_with?("~")
166
- clean_path = File.expand_path(questionable_path, "/")
167
+ clean_path = questionable_path.dup
168
+ clean_path.insert(0, "/") if clean_path.start_with?("~")
169
+ clean_path = File.expand_path(clean_path, "/")
167
170
 
168
171
  return clean_path if clean_path.eql?(base_directory)
169
172
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "set"
2
4
 
3
5
  module Jekyll
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Jekyll
2
4
  class Collection
3
5
  attr_reader :site, :label, :metadata
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Jekyll
2
4
  class Command
3
5
  class << self
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Jekyll
2
4
  module Commands
3
5
  class Build < Command
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Jekyll
2
4
  module Commands
3
5
  class Clean < Command
@@ -1,3 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "addressable/uri"
4
+
1
5
  module Jekyll
2
6
  module Commands
3
7
  class Doctor < Command
@@ -36,6 +40,7 @@ module Jekyll
36
40
  !deprecated_relative_permalinks(site),
37
41
  !conflicting_urls(site),
38
42
  !urls_only_differ_by_case(site),
43
+ proper_site_url?(site),
39
44
  ].all?
40
45
  end
41
46
 
@@ -91,6 +96,15 @@ module Jekyll
91
96
  urls_only_differ_by_case
92
97
  end
93
98
 
99
+ def proper_site_url?(site)
100
+ url = site.config["url"]
101
+ [
102
+ url_exists?(url),
103
+ url_valid?(url),
104
+ url_absolute(url),
105
+ ].all?
106
+ end
107
+
94
108
  private
95
109
  def collect_urls(urls, things, destination)
96
110
  things.each do |thing|
@@ -110,6 +124,29 @@ module Jekyll
110
124
  (memo[dest.downcase] ||= []) << dest
111
125
  end
112
126
  end
127
+
128
+ def url_exists?(url)
129
+ return true unless url.nil? || url.empty?
130
+ Jekyll.logger.warn "Warning:", "You didn't set an URL in the config file, "\
131
+ "you may encounter problems with some plugins."
132
+ false
133
+ end
134
+
135
+ def url_valid?(url)
136
+ Addressable::URI.parse(url)
137
+ true
138
+ rescue
139
+ Jekyll.logger.warn "Warning:", "The site URL does not seem to be valid, "\
140
+ "check the value of `url` in your config file."
141
+ false
142
+ end
143
+
144
+ def url_absolute(url)
145
+ return true if Addressable::URI.parse(url).absolute?
146
+ Jekyll.logger.warn "Warning:", "Your site URL does not seem to be absolute, "\
147
+ "check the value of `url` in your config file."
148
+ false
149
+ end
113
150
  end
114
151
  end
115
152
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Jekyll
2
4
  module Commands
3
5
  class Help < Command
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "erb"
2
4
 
3
5
  module Jekyll
@@ -70,7 +72,7 @@ source "https://rubygems.org"
70
72
  #
71
73
  # This will help ensure the proper Jekyll version is running.
72
74
  # Happy Jekylling!
73
- gem "jekyll", "#{Jekyll::VERSION}"
75
+ gem "jekyll", "~> #{Jekyll::VERSION}"
74
76
 
75
77
  # This is the default theme for new Jekyll sites. You may change this to anything you like.
76
78
  gem "minima", "~> 2.0"
@@ -81,7 +83,7 @@ gem "minima", "~> 2.0"
81
83
 
82
84
  # If you have any plugins, put them here!
83
85
  group :jekyll_plugins do
84
- gem "jekyll-feed", "~> 0.6"
86
+ gem "jekyll-feed", "~> 0.6"
85
87
  end
86
88
 
87
89
  # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
@@ -113,7 +115,7 @@ RUBY
113
115
  end
114
116
 
115
117
  def site_template
116
- File.expand_path("../../site_template", File.dirname(__FILE__))
118
+ File.expand_path("../../site_template", __dir__)
117
119
  end
118
120
 
119
121
  def scaffold_path
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "erb"
2
4
 
3
5
  class Jekyll::Commands::NewTheme < Jekyll::Command
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Jekyll
2
4
  module Commands
3
5
  class Serve < Command
@@ -234,7 +236,7 @@ module Jekyll
234
236
 
235
237
  private
236
238
  def mime_types
237
- file = File.expand_path("../mime.types", File.dirname(__FILE__))
239
+ file = File.expand_path("../mime.types", __dir__)
238
240
  WEBrick::HTTPUtils.load_mime_types(file)
239
241
  end
240
242
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "webrick"
2
4
 
3
5
  module Jekyll
@@ -22,7 +24,7 @@ module Jekyll
22
24
 
23
25
  def search_file(req, res, basename)
24
26
  # /file.* > /file/index.html > /file.html
25
- super || super(req, res, "#{basename}.html")
27
+ super || super(req, res, ".html") || super(req, res, "#{basename}.html")
26
28
  end
27
29
 
28
30
  # rubocop:disable Style/MethodName
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Jekyll
4
5
  class Configuration < Hash
@@ -155,7 +156,7 @@ module Jekyll
155
156
  )
156
157
 
157
158
  # Get configuration from <source>/_config.yml or <source>/<config_file>
158
- config_files = override.delete("config")
159
+ config_files = override["config"]
159
160
  if config_files.to_s.empty?
160
161
  default = %w(yml yaml).find(-> { "yml" }) do |ext|
161
162
  File.exist?(Jekyll.sanitized_path(source(override), "_config.#{ext}"))
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Jekyll
2
4
  class Converter < Plugin
3
5
  # Public: Get or set the highlighter prefix. When an argument is specified,
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Jekyll
2
4
  module Converters
3
5
  class Identity < Converter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Jekyll
2
4
  module Converters
3
5
  class Markdown < Converter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Jekyll
2
4
  module Converters
3
5
  class Markdown
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Jekyll::Converters::Markdown::RedcarpetParser
2
4
  module CommonMethods
3
5
  def add_code_tags(code, lang)
@@ -48,14 +50,12 @@ class Jekyll::Converters::Markdown::RedcarpetParser
48
50
  def block_code(code, lang)
49
51
  code = "<pre>#{super}</pre>"
50
52
 
51
- output = "<div class=\"highlight\">"
52
- output << add_code_tags(code, lang)
53
- output << "</div>"
53
+ "<div class=\"highlight\">#{add_code_tags(code, lang)}</div>"
54
54
  end
55
55
 
56
56
  protected
57
57
  def rouge_formatter(_lexer)
58
- Rouge::Formatters::HTML.new(:wrap => false)
58
+ Jekyll::Utils::Rouge.html_formatter(:wrap => false)
59
59
  end
60
60
  end
61
61
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Kramdown::Parser::SmartyPants < Kramdown::Parser::Kramdown
2
4
  def initialize(source, options)
3
5
  super
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  require "set"
4
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Jekyll
2
4
  module Deprecator
3
5
  extend self
@@ -5,7 +7,7 @@ module Jekyll
5
7
  def process(args)
6
8
  arg_is_present? args, "--server", "The --server command has been replaced by the \
7
9
  'serve' subcommand."
8
- arg_is_present? args, "--serve", "The --server command has been replaced by the \
10
+ arg_is_present? args, "--serve", "The --serve command has been replaced by the \
9
11
  'serve' subcommand."
10
12
  arg_is_present? args, "--no-server", "To build Jekyll without launching a server, \
11
13
  use the 'build' subcommand."
@@ -46,6 +48,5 @@ module Jekyll
46
48
  Jekyll.logger.warn "Defaults:", "Please update your front-matter defaults to use \
47
49
  'type: #{current}'."
48
50
  end
49
-
50
51
  end
51
52
  end
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Jekyll
4
5
  class Document
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Jekyll
4
5
  module Drops
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Jekyll
4
5
  module Drops
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Jekyll
4
5
  module Drops
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Jekyll
4
5
  module Drops
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Jekyll
4
5
  module Drops
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Jekyll
4
5
  module Drops
@@ -37,6 +38,9 @@ module Jekyll
37
38
  @site_collections ||= @obj.collections.values.sort_by(&:label).map(&:to_liquid)
38
39
  end
39
40
 
41
+ # return nil for `{{ site.config }}` even if --config was passed via CLI
42
+ def config; end
43
+
40
44
  private
41
45
  def_delegator :@obj, :config, :fallback_data
42
46
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Jekyll
2
4
  module Drops
3
5
  class StaticFileDrop < Drop
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Jekyll
4
5
  module Drops
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Jekyll
4
5
  module Drops