jekyll 3.1.0.pre.beta1 → 3.1.0.pre.rc1

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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.markdown +1 -0
  4. data/bin/jekyll +17 -8
  5. data/lib/jekyll.rb +6 -6
  6. data/lib/jekyll/cleaner.rb +1 -1
  7. data/lib/jekyll/collection.rb +8 -7
  8. data/lib/jekyll/command.rb +0 -4
  9. data/lib/jekyll/commands/build.rb +2 -6
  10. data/lib/jekyll/commands/clean.rb +1 -3
  11. data/lib/jekyll/commands/doctor.rb +15 -19
  12. data/lib/jekyll/commands/help.rb +0 -2
  13. data/lib/jekyll/commands/serve.rb +11 -3
  14. data/lib/jekyll/commands/serve/servlet.rb +3 -3
  15. data/lib/jekyll/configuration.rb +28 -29
  16. data/lib/jekyll/converters/identity.rb +1 -1
  17. data/lib/jekyll/converters/markdown.rb +7 -7
  18. data/lib/jekyll/converters/markdown/rdiscount_parser.rb +1 -1
  19. data/lib/jekyll/converters/markdown/redcarpet_parser.rb +5 -6
  20. data/lib/jekyll/converters/smartypants.rb +34 -0
  21. data/lib/jekyll/convertible.rb +29 -16
  22. data/lib/jekyll/deprecator.rb +1 -1
  23. data/lib/jekyll/document.rb +26 -27
  24. data/lib/jekyll/drops/collection_drop.rb +0 -2
  25. data/lib/jekyll/drops/document_drop.rb +0 -1
  26. data/lib/jekyll/drops/drop.rb +54 -6
  27. data/lib/jekyll/drops/site_drop.rb +0 -1
  28. data/lib/jekyll/drops/unified_payload_drop.rb +0 -1
  29. data/lib/jekyll/drops/url_drop.rb +45 -13
  30. data/lib/jekyll/entry_filter.rb +1 -1
  31. data/lib/jekyll/errors.rb +4 -2
  32. data/lib/jekyll/external.rb +5 -6
  33. data/lib/jekyll/filters.rb +18 -7
  34. data/lib/jekyll/frontmatter_defaults.rb +16 -15
  35. data/lib/jekyll/generator.rb +1 -2
  36. data/lib/jekyll/hooks.rb +26 -26
  37. data/lib/jekyll/liquid_renderer.rb +1 -1
  38. data/lib/jekyll/liquid_renderer/table.rb +2 -2
  39. data/lib/jekyll/page.rb +7 -8
  40. data/lib/jekyll/plugin.rb +31 -12
  41. data/lib/jekyll/plugin_manager.rb +3 -4
  42. data/lib/jekyll/reader.rb +7 -7
  43. data/lib/jekyll/readers/collection_reader.rb +1 -2
  44. data/lib/jekyll/readers/data_reader.rb +7 -7
  45. data/lib/jekyll/readers/page_reader.rb +3 -3
  46. data/lib/jekyll/readers/post_reader.rb +2 -2
  47. data/lib/jekyll/readers/static_file_reader.rb +2 -2
  48. data/lib/jekyll/regenerator.rb +17 -18
  49. data/lib/jekyll/related_posts.rb +0 -2
  50. data/lib/jekyll/renderer.rb +14 -12
  51. data/lib/jekyll/site.rb +18 -22
  52. data/lib/jekyll/static_file.rb +15 -15
  53. data/lib/jekyll/stevenson.rb +2 -2
  54. data/lib/jekyll/tags/highlight.rb +10 -11
  55. data/lib/jekyll/tags/include.rb +10 -11
  56. data/lib/jekyll/tags/post_url.rb +7 -10
  57. data/lib/jekyll/url.rb +4 -5
  58. data/lib/jekyll/utils.rb +27 -22
  59. data/lib/jekyll/utils/ansi.rb +1 -1
  60. data/lib/jekyll/utils/platforms.rb +0 -1
  61. data/lib/jekyll/version.rb +1 -1
  62. data/lib/site_template/_includes/head.html +1 -1
  63. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1829f10339d166e837fcab131e2a71f8b7354ef
4
- data.tar.gz: 9e9401c86a39df7af91aa72ce6f427fcbbff3c48
3
+ metadata.gz: 5da26c7d190e158f8259ccab996f37dbdeab27f6
4
+ data.tar.gz: 78d017c3d93a9a91ba2ada36ab1f3522c72d7b16
5
5
  SHA512:
6
- metadata.gz: 57d2d84faf740f163963b8649ae08b1dc27f84352e4f9e6539bef4ce0eb20582efe75a15b16b05aab41369f2cdcab7b0d3f371bd6ab1b2cdeabcd31d0dfe504c
7
- data.tar.gz: 440f77af890b49b98f74f389b204c0f3c920215ad366fab6727fcea45c562113a8decd99de82c5ce1fe5fb32ad8755727d5705ee60ffe663bb213de7cf2354be
6
+ metadata.gz: cd566922d0e9b2f8e6e5cba893ed419d304b0e250145800d455a5e3eac66dfb6de3ce123535f76bc68600e7dfa999ab9f4759af207181b1a82c918f7b2db3d6f
7
+ data.tar.gz: 0d0d806095422d586cc4775197b897130ae36e0eb550d0d5b71c5503b1c2e34004d1530f9a5fbebf3a53837b7a4571494c2665ed98a786416e1d1c22a27be10e
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2008-2015 Tom Preston-Werner
3
+ Copyright (c) 2008-2016 Tom Preston-Werner
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -3,6 +3,7 @@
3
3
  [![Gem Version](https://img.shields.io/gem/v/jekyll.svg)](https://rubygems.org/gems/jekyll)
4
4
  [![Build Status](https://img.shields.io/travis/jekyll/jekyll/master.svg)](https://travis-ci.org/jekyll/jekyll)
5
5
  [![Code Climate](https://img.shields.io/codeclimate/github/jekyll/jekyll.svg)](https://codeclimate.com/github/jekyll/jekyll)
6
+ [![Test Coverage](https://codeclimate.com/github/jekyll/jekyll/badges/coverage.svg)](https://codeclimate.com/github/jekyll/jekyll/coverage)
6
7
  [![Dependency Status](https://gemnasium.com/jekyll/jekyll.svg)](https://gemnasium.com/jekyll/jekyll)
7
8
  [![Security](https://hakiri.io/github/jekyll/jekyll/master.svg)](https://hakiri.io/github/jekyll/jekyll/master)
8
9
 
data/bin/jekyll CHANGED
@@ -1,15 +1,11 @@
1
1
  #!/usr/bin/env ruby
2
2
  STDOUT.sync = true
3
3
 
4
- $:.unshift File.join(File.dirname(__FILE__), *%w{ .. lib })
4
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), *%w( .. lib ))
5
5
 
6
6
  require 'jekyll'
7
7
  require 'mercenary'
8
8
 
9
- Jekyll::External.require_if_present(
10
- Jekyll::External.blessed_gems
11
- )
12
-
13
9
  Jekyll::PluginManager.require_from_bundler
14
10
 
15
11
  Jekyll::Deprecator.process(ARGV)
@@ -26,16 +22,29 @@ Mercenary.program(:jekyll) do |p|
26
22
  p.option 'layouts_dir', '--layouts DIR', String, 'Layouts directory (defaults to ./_layouts)'
27
23
  p.option 'profile', '--profile', 'Generate a Liquid rendering profile'
28
24
 
25
+ Jekyll::External.require_if_present(Jekyll::External.blessed_gems) do |g|
26
+ cmd = g.split('-').last
27
+ p.command(cmd.to_sym) do |c|
28
+ c.syntax cmd
29
+ c.action do
30
+ Jekyll.logger.abort_with "You must install the '#{g}' gem to use the 'jekyll #{cmd}' command."
31
+ end
32
+ end
33
+ end
34
+
29
35
  Jekyll::Command.subclasses.each { |c| c.init_with_program(p) }
30
36
 
31
- p.action do |args, options|
37
+ p.action do |args, _|
32
38
  if args.empty?
33
39
  Jekyll.logger.error "A subcommand is required."
34
40
  puts p
35
41
  abort
36
42
  else
37
- unless p.has_command?(args.first)
38
- Jekyll.logger.abort_with "Invalid command. Use --help for more information"
43
+ subcommand = args.first
44
+ unless p.has_command? subcommand
45
+ Jekyll.logger.abort_with "fatal: 'jekyll #{args.first}' could not" \
46
+ " be found. You may need to install the jekyll-#{args.first} gem" \
47
+ " or a related gem to be able to use this subcommand."
39
48
  end
40
49
  end
41
50
  end
@@ -1,4 +1,4 @@
1
- $:.unshift File.dirname(__FILE__) # For use/testing when no gem is installed
1
+ $LOAD_PATH.unshift File.dirname(__FILE__) # For use/testing when no gem is installed
2
2
 
3
3
  # Require all of the Ruby files in the given directory.
4
4
  #
@@ -95,7 +95,7 @@ module Jekyll
95
95
  # list of option names and their defaults.
96
96
  #
97
97
  # Returns the final configuration Hash.
98
- def configuration(override = Hash.new)
98
+ def configuration(override = {})
99
99
  config = Configuration[Configuration::DEFAULTS]
100
100
  override = Configuration[override].stringify_keys
101
101
  unless override.delete('skip_config_files')
@@ -156,19 +156,19 @@ module Jekyll
156
156
  clean_path = File.expand_path(questionable_path, "/")
157
157
  clean_path = clean_path.sub(/\A\w\:\//, '/')
158
158
 
159
- unless clean_path.start_with?(base_directory.sub(/\A\w\:\//, '/'))
160
- File.join(base_directory, clean_path)
161
- else
159
+ if clean_path.start_with?(base_directory.sub(/\A\w\:\//, '/'))
162
160
  clean_path
161
+ else
162
+ File.join(base_directory, clean_path)
163
163
  end
164
164
  end
165
165
 
166
166
  # Conditional optimizations
167
167
  Jekyll::External.require_if_present('liquid-c')
168
-
169
168
  end
170
169
  end
171
170
 
171
+ require "jekyll/drops/drop"
172
172
  require_all 'jekyll/commands'
173
173
  require_all 'jekyll/converters'
174
174
  require_all 'jekyll/converters/markdown'
@@ -13,7 +13,7 @@ module Jekyll
13
13
  # Cleans up the site's destination directory
14
14
  def cleanup!
15
15
  FileUtils.rm_rf(obsolete_files)
16
- FileUtils.rm_rf(metadata_file) if !@site.incremental?
16
+ FileUtils.rm_rf(metadata_file) unless @site.incremental?
17
17
  end
18
18
 
19
19
  private
@@ -56,7 +56,7 @@ module Jekyll
56
56
  full_path = collection_dir(file_path)
57
57
  next if File.directory?(full_path)
58
58
  if Utils.has_yaml_header? full_path
59
- doc = Jekyll::Document.new(full_path, { site: site, collection: self })
59
+ doc = Jekyll::Document.new(full_path, { :site => site, :collection => self })
60
60
  doc.read
61
61
  if site.publisher.publish?(doc) || !write?
62
62
  docs << doc
@@ -76,10 +76,11 @@ module Jekyll
76
76
  # Returns an Array of file paths to the documents in this collection
77
77
  # relative to the collection's directory
78
78
  def entries
79
- return Array.new unless exists?
79
+ return [] unless exists?
80
80
  @entries ||=
81
81
  Utils.safe_glob(collection_dir, ["**", "*.*"]).map do |entry|
82
- entry["#{collection_dir}/"] = ''; entry
82
+ entry["#{collection_dir}/"] = ''
83
+ entry
83
84
  end
84
85
  end
85
86
 
@@ -88,7 +89,7 @@ module Jekyll
88
89
  #
89
90
  # Returns a list of filtered entry paths.
90
91
  def filtered_entries
91
- return Array.new unless exists?
92
+ return [] unless exists?
92
93
  @filtered_entries ||=
93
94
  Dir.chdir(directory) do
94
95
  entry_filter.filter(entries).reject do |f|
@@ -185,8 +186,8 @@ module Jekyll
185
186
  #
186
187
  # Returns the URL template to render collection's documents at.
187
188
  def url_template
188
- metadata.fetch('permalink') do
189
- Utils.add_permalink_suffix("/:collection/:path", site.permalink_style)
189
+ @url_template ||= metadata.fetch('permalink') do
190
+ Utils.add_permalink_suffix("/:collection/:path", site.permalink_style)
190
191
  end
191
192
  end
192
193
 
@@ -195,7 +196,7 @@ module Jekyll
195
196
  # Returns the metadata for this collection
196
197
  def extract_metadata
197
198
  if site.config['collections'].is_a?(Hash)
198
- site.config['collections'][label] || Hash.new
199
+ site.config['collections'][label] || {}
199
200
  else
200
201
  {}
201
202
  end
@@ -1,8 +1,6 @@
1
1
  module Jekyll
2
2
  class Command
3
-
4
3
  class << self
5
-
6
4
  # A list of subclasses of Jekyll::Command
7
5
  def subclasses
8
6
  @subclasses ||= []
@@ -62,8 +60,6 @@ module Jekyll
62
60
  c.option 'verbose', '-V', '--verbose', 'Print verbose output.'
63
61
  c.option 'incremental', '-I', '--incremental', 'Enable incremental rebuild.'
64
62
  end
65
-
66
63
  end
67
-
68
64
  end
69
65
  end
@@ -1,9 +1,7 @@
1
1
  module Jekyll
2
2
  module Commands
3
3
  class Build < Command
4
-
5
4
  class << self
6
-
7
5
  # Create the Mercenary command for the Jekyll CLI for this Command
8
6
  def init_with_program(prog)
9
7
  prog.command(:build) do |c|
@@ -13,7 +11,7 @@ module Jekyll
13
11
 
14
12
  add_build_options(c)
15
13
 
16
- c.action do |args, options|
14
+ c.action do |_, options|
17
15
  options["serving"] = false
18
16
  Jekyll::Commands::Build.process(options)
19
17
  end
@@ -67,13 +65,11 @@ module Jekyll
67
65
  # options - A Hash of options passed to the command
68
66
  #
69
67
  # Returns nothing.
70
- def watch(site, options)
68
+ def watch(_site, options)
71
69
  External.require_with_graceful_fail 'jekyll-watch'
72
70
  Jekyll::Watcher.watch(options)
73
71
  end
74
-
75
72
  end # end of class << self
76
-
77
73
  end
78
74
  end
79
75
  end
@@ -2,7 +2,6 @@ module Jekyll
2
2
  module Commands
3
3
  class Clean < Command
4
4
  class << self
5
-
6
5
  def init_with_program(prog)
7
6
  prog.command(:clean) do |c|
8
7
  c.syntax 'clean [subcommand]'
@@ -10,7 +9,7 @@ module Jekyll
10
9
 
11
10
  add_build_options(c)
12
11
 
13
- c.action do |args, options|
12
+ c.action do |_, options|
14
13
  Jekyll::Commands::Clean.process(options)
15
14
  end
16
15
  end
@@ -37,7 +36,6 @@ module Jekyll
37
36
  Jekyll.logger.info "Nothing to do for #{metadata_file}."
38
37
  end
39
38
  end
40
-
41
39
  end
42
40
  end
43
41
  end
@@ -2,7 +2,6 @@ module Jekyll
2
2
  module Commands
3
3
  class Doctor < Command
4
4
  class << self
5
-
6
5
  def init_with_program(prog)
7
6
  prog.command(:doctor) do |c|
8
7
  c.syntax 'doctor'
@@ -11,7 +10,7 @@ module Jekyll
11
10
 
12
11
  c.option '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
13
12
 
14
- c.action do |args, options|
13
+ c.action do |_, options|
15
14
  Jekyll::Commands::Doctor.process(options)
16
15
  end
17
16
  end
@@ -39,8 +38,8 @@ module Jekyll
39
38
 
40
39
  def deprecated_relative_permalinks(site)
41
40
  if site.config['relative_permalinks']
42
- Jekyll::Deprecator.deprecation_message "Your site still uses relative" +
43
- " permalinks, which was removed in" +
41
+ Jekyll::Deprecator.deprecation_message "Your site still uses relative" \
42
+ " permalinks, which was removed in" \
44
43
  " Jekyll v3.0.0."
45
44
  return true
46
45
  end
@@ -52,17 +51,16 @@ module Jekyll
52
51
  urls = collect_urls(urls, site.pages, site.dest)
53
52
  urls = collect_urls(urls, site.posts.docs, site.dest)
54
53
  urls.each do |url, paths|
55
- if paths.size > 1
56
- conflicting_urls = true
57
- Jekyll.logger.warn "Conflict:", "The URL '#{url}' is the destination" +
58
- " for the following pages: #{paths.join(", ")}"
59
- end
54
+ next unless paths.size > 1
55
+ conflicting_urls = true
56
+ Jekyll.logger.warn "Conflict:", "The URL '#{url}' is the destination" \
57
+ " for the following pages: #{paths.join(", ")}"
60
58
  end
61
59
  conflicting_urls
62
60
  end
63
61
 
64
- def fsnotify_buggy?(site)
65
- return true if !Utils::Platforms.osx?
62
+ def fsnotify_buggy?(_site)
63
+ return true unless Utils::Platforms.osx?
66
64
  if Dir.pwd != `pwd`.strip
67
65
  Jekyll.logger.error " " + <<-STR.strip.gsub(/\n\s+/, "\n ")
68
66
  We have detected that there might be trouble using fsevent on your
@@ -81,12 +79,11 @@ module Jekyll
81
79
  urls_only_differ_by_case = false
82
80
  urls = case_insensitive_urls(site.pages + site.docs_to_write, site.dest)
83
81
  urls.each do |case_insensitive_url, real_urls|
84
- if real_urls.uniq.size > 1
85
- urls_only_differ_by_case = true
86
- Jekyll.logger.warn "Warning:", "The following URLs only differ" +
87
- " by case. On a case-insensitive file system one of the URLs" +
88
- " will be overwritten by the other: #{real_urls.join(", ")}"
89
- end
82
+ next unless real_urls.uniq.size > 1
83
+ urls_only_differ_by_case = true
84
+ Jekyll.logger.warn "Warning:", "The following URLs only differ" \
85
+ " by case. On a case-insensitive file system one of the URLs" \
86
+ " will be overwritten by the other: #{real_urls.join(", ")}"
90
87
  end
91
88
  urls_only_differ_by_case
92
89
  end
@@ -105,14 +102,13 @@ module Jekyll
105
102
  end
106
103
 
107
104
  def case_insensitive_urls(things, destination)
108
- things.inject(Hash.new) do |memo, thing|
105
+ things.inject({}) do |memo, thing|
109
106
  dest = thing.destination(destination)
110
107
  (memo[dest.downcase] ||= []) << dest
111
108
  memo
112
109
  end
113
110
  end
114
111
  end
115
-
116
112
  end
117
113
  end
118
114
  end
@@ -2,7 +2,6 @@ module Jekyll
2
2
  module Commands
3
3
  class Help < Command
4
4
  class << self
5
-
6
5
  def init_with_program(prog)
7
6
  prog.command(:help) do |c|
8
7
  c.syntax 'help [subcommand]'
@@ -26,7 +25,6 @@ module Jekyll
26
25
  Jekyll.logger.error "Error:", "Hmm... we don't know what the '#{cmd}' command is."
27
26
  Jekyll.logger.info "Valid commands:", prog.commands.keys.join(", ")
28
27
  end
29
-
30
28
  end
31
29
  end
32
30
  end
@@ -103,7 +103,7 @@ module Jekyll
103
103
  WEBrick::Config::FileHandler.merge({
104
104
  :FancyIndexing => true,
105
105
  :NondisclosureName => [
106
- '.ht*','~*'
106
+ '.ht*', '~*'
107
107
  ]
108
108
  })
109
109
  end
@@ -123,7 +123,14 @@ module Jekyll
123
123
 
124
124
  private
125
125
  def launch_browser(server, opts)
126
- command = Utils::Platforms.windows?? "start" : Utils::Platforms.osx?? "open" : "xdg-open"
126
+ command =
127
+ if Utils::Platforms.windows?
128
+ "start"
129
+ elsif Utils::Platforms.osx?
130
+ "open"
131
+ else
132
+ "xdg-open"
133
+ end
127
134
  system command, server_address(server, opts)
128
135
  end
129
136
 
@@ -168,7 +175,8 @@ module Jekyll
168
175
  raise RuntimeError, "--ssl-cert or --ssl-key missing."
169
176
  end
170
177
 
171
- require "openssl"; require "webrick/https"
178
+ require "openssl"
179
+ require "webrick/https"
172
180
  source_key = Jekyll.sanitized_path(opts[:JekyllOptions]["source"], opts[:JekyllOptions]["ssl_key" ])
173
181
  source_certificate = Jekyll.sanitized_path(opts[:JekyllOptions]["source"], opts[:JekyllOptions]["ssl_cert"])
174
182
  opts[:SSLCertificate] = OpenSSL::X509::Certificate.new(File.read(source_certificate))
@@ -17,7 +17,7 @@ module Jekyll
17
17
  end
18
18
 
19
19
  # Add the ability to tap file.html the same way that Nginx does on our
20
- # Docker images (or on Github pages.) The difference is that we might end
20
+ # Docker images (or on GitHub Pages.) The difference is that we might end
21
21
  # up with a different preference on which comes first.
22
22
 
23
23
  def search_file(req, res, basename)
@@ -37,7 +37,7 @@ module Jekyll
37
37
  #
38
38
 
39
39
  private
40
- def validate_and_ensure_charset(req, res)
40
+ def validate_and_ensure_charset(_req, res)
41
41
  key = res.header.keys.grep(/content-type/i).first
42
42
  typ = res.header[key]
43
43
 
@@ -52,7 +52,7 @@ module Jekyll
52
52
  def set_defaults
53
53
  hash_ = @jekyll_opts.fetch("webrick", {}).fetch("headers", {})
54
54
  DEFAULTS.each_with_object(@headers = hash_) do |(key, val), hash|
55
- hash[key] = val if !hash.key?(key)
55
+ hash[key] = val unless hash.key?(key)
56
56
  end
57
57
  end
58
58
  end
@@ -2,7 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  class Configuration < Hash
5
-
6
5
  # Default options. Overridden by values in _config.yml.
7
6
  # Strings rather than symbols are used for compatibility with YAML.
8
7
  DEFAULTS = Configuration[{
@@ -19,7 +18,7 @@ module Jekyll
19
18
  'safe' => false,
20
19
  'include' => ['.htaccess'],
21
20
  'exclude' => [],
22
- 'keep_files' => ['.git','.svn'],
21
+ 'keep_files' => ['.git', '.svn'],
23
22
  'encoding' => 'utf-8',
24
23
  'markdown_ext' => 'markdown,mkdown,mkdn,mkd,md',
25
24
 
@@ -78,7 +77,7 @@ module Jekyll
78
77
  #
79
78
  # Return a copy of the hash where all its keys are strings
80
79
  def stringify_keys
81
- reduce({}) { |hsh,(k,v)| hsh.merge(k.to_s => v) }
80
+ reduce({}) { |hsh, (k, v)| hsh.merge(k.to_s => v) }
82
81
  end
83
82
 
84
83
  def get_config_value_with_override(config_key, override)
@@ -128,7 +127,7 @@ module Jekyll
128
127
  # Get configuration from <source>/_config.yml or <source>/<config_file>
129
128
  config_files = override.delete('config')
130
129
  if config_files.to_s.empty?
131
- default = %w[yml yaml].find(Proc.new { 'yml' }) do |ext|
130
+ default = %w(yml yaml).find(-> { 'yml' }) do |ext|
132
131
  File.exist?(Jekyll.sanitized_path(source(override), "_config.#{ext}"))
133
132
  end
134
133
  config_files = Jekyll.sanitized_path(source(override), "_config.#{default}")
@@ -173,7 +172,7 @@ module Jekyll
173
172
  configuration = Utils.deep_merge_hashes(configuration, new_config)
174
173
  end
175
174
  rescue ArgumentError => err
176
- Jekyll.logger.warn "WARNING:", "Error reading configuration. " +
175
+ Jekyll.logger.warn "WARNING:", "Error reading configuration. " \
177
176
  "Using defaults (and options)."
178
177
  $stderr.puts "#{err}"
179
178
  end
@@ -198,16 +197,16 @@ module Jekyll
198
197
  config = clone
199
198
  # Provide backwards-compatibility
200
199
  if config.key?('auto') || config.key?('watch')
201
- Jekyll::Deprecator.deprecation_message "Auto-regeneration can no longer" +
202
- " be set from your configuration file(s). Use the"+
200
+ Jekyll::Deprecator.deprecation_message "Auto-regeneration can no longer" \
201
+ " be set from your configuration file(s). Use the"\
203
202
  " --[no-]watch/-w command-line option instead."
204
203
  config.delete('auto')
205
204
  config.delete('watch')
206
205
  end
207
206
 
208
207
  if config.key? 'server'
209
- Jekyll::Deprecator.deprecation_message "The 'server' configuration option" +
210
- " is no longer accepted. Use the 'jekyll serve'" +
208
+ Jekyll::Deprecator.deprecation_message "The 'server' configuration option" \
209
+ " is no longer accepted. Use the 'jekyll serve'" \
211
210
  " subcommand to serve your site with WEBrick."
212
211
  config.delete('server')
213
212
  end
@@ -218,21 +217,21 @@ module Jekyll
218
217
  renamed_key 'data_source', 'data_dir', config
219
218
 
220
219
  if config.key? 'pygments'
221
- Jekyll::Deprecator.deprecation_message "The 'pygments' configuration option" +
222
- " has been renamed to 'highlighter'. Please update your" +
223
- " config file accordingly. The allowed values are 'rouge', " +
220
+ Jekyll::Deprecator.deprecation_message "The 'pygments' configuration option" \
221
+ " has been renamed to 'highlighter'. Please update your" \
222
+ " config file accordingly. The allowed values are 'rouge', " \
224
223
  "'pygments' or null."
225
224
 
226
225
  config['highlighter'] = 'pygments' if config['pygments']
227
226
  config.delete('pygments')
228
227
  end
229
228
 
230
- %w[include exclude].each do |option|
229
+ %w(include exclude).each do |option|
231
230
  config[option] ||= []
232
231
  if config[option].is_a?(String)
233
- Jekyll::Deprecator.deprecation_message "The '#{option}' configuration option" +
234
- " must now be specified as an array, but you specified" +
235
- " a string. For now, we've treated the string you provided" +
232
+ Jekyll::Deprecator.deprecation_message "The '#{option}' configuration option" \
233
+ " must now be specified as an array, but you specified" \
234
+ " a string. For now, we've treated the string you provided" \
236
235
  " as a list of comma-separated values."
237
236
  config[option] = csv_to_array(config[option])
238
237
  end
@@ -240,16 +239,16 @@ module Jekyll
240
239
  end
241
240
 
242
241
  if (config['kramdown'] || {}).key?('use_coderay')
243
- Jekyll::Deprecator.deprecation_message "Please change 'use_coderay'" +
242
+ Jekyll::Deprecator.deprecation_message "Please change 'use_coderay'" \
244
243
  " to 'enable_coderay' in your configuration file."
245
244
  config['kramdown']['use_coderay'] = config['kramdown'].delete('enable_coderay')
246
245
  end
247
246
 
248
247
  if config.fetch('markdown', 'kramdown').to_s.downcase.eql?("maruku")
249
- Jekyll.logger.abort_with "Error:", "You're using the 'maruku' " +
250
- "Markdown processor, which has been removed as of 3.0.0. " +
251
- "We recommend you switch to Kramdown. To do this, replace " +
252
- "`markdown: maruku` with `markdown: kramdown` in your " +
248
+ Jekyll.logger.abort_with "Error:", "You're using the 'maruku' " \
249
+ "Markdown processor, which has been removed as of 3.0.0. " \
250
+ "We recommend you switch to Kramdown. To do this, replace " \
251
+ "`markdown: maruku` with `markdown: kramdown` in your " \
253
252
  "`_config.yml` file."
254
253
  end
255
254
 
@@ -260,7 +259,7 @@ module Jekyll
260
259
  config = clone
261
260
 
262
261
  if config.key?('paginate') && (!config['paginate'].is_a?(Integer) || config['paginate'] < 1)
263
- Jekyll.logger.warn "Config Warning:", "The `paginate` key must be a" +
262
+ Jekyll.logger.warn "Config Warning:", "The `paginate` key must be a" \
264
263
  " positive integer or nil. It's currently set to '#{config['paginate'].inspect}'."
265
264
  config['paginate'] = nil
266
265
  end
@@ -274,7 +273,7 @@ module Jekyll
274
273
  return config if config['collections'].nil?
275
274
 
276
275
  if config['collections'].is_a?(Array)
277
- config['collections'] = Hash[config['collections'].map{|c| [c, {}]}]
276
+ config['collections'] = Hash[config['collections'].map { |c| [c, {}] }]
278
277
  end
279
278
  config['collections']['posts'] ||= {}
280
279
  config['collections']['posts']['output'] = true
@@ -283,10 +282,10 @@ module Jekyll
283
282
  config
284
283
  end
285
284
 
286
- def renamed_key(old, new, config, allowed_values = nil)
285
+ def renamed_key(old, new, config, _ = nil)
287
286
  if config.key?(old)
288
- Jekyll::Deprecator.deprecation_message "The '#{old}' configuration" +
289
- "option has been renamed to '#{new}'. Please update your config " +
287
+ Jekyll::Deprecator.deprecation_message "The '#{old}' configuration" \
288
+ "option has been renamed to '#{new}'. Please update your config " \
290
289
  "file accordingly."
291
290
  config[new] = config.delete(old)
292
291
  end
@@ -299,11 +298,11 @@ module Jekyll
299
298
  when :pretty
300
299
  "/:categories/:year/:month/:day/:title/"
301
300
  when :none
302
- "/:categories/:title.html"
301
+ "/:categories/:title:output_ext"
303
302
  when :date
304
- "/:categories/:year/:month/:day/:title.html"
303
+ "/:categories/:year/:month/:day/:title:output_ext"
305
304
  when :ordinal
306
- "/:categories/:year/:y_day/:title.html"
305
+ "/:categories/:year/:y_day/:title:output_ext"
307
306
  else
308
307
  permalink_style.to_s
309
308
  end