jekyll 3.0.0 → 3.0.1

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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e88fc19236626a5262042dcee0eba9e824f2eb1
4
- data.tar.gz: 69faaa1a1f0ac7eb621619a6658010a26bd991ca
3
+ metadata.gz: e7a714a746d474d294968912e1d95d793174165c
4
+ data.tar.gz: a8d08a44906ec34cba1c3fd3889db31ca5bfafb8
5
5
  SHA512:
6
- metadata.gz: 1878376020d78eb078bc4835d5a5c4536ff63f944afcf21310f003f1c5939bd81d693a3fc34f03c85c090326e714acd5dd0f8ac878d5f93835c8cbf574a2e252
7
- data.tar.gz: a8acc42139aa5a7fe374c5428a7d79e9d5f10e6809715a056dad5c252026e5f404a89181290c9a17267e4c93104e3521c1493b60620bdcba862cbdbd1b915b17
6
+ metadata.gz: 3da575bed2b088a6b33dbbbe5bde105adb4fee9bf6812a4274030bbcac74816084071a9a1b345c27178c0b40625c668cf61f3a80e9838045ec3119228fde7fc7
7
+ data.tar.gz: 0dd32ac1af7b9a182df355f6bb6f04f210c070f0d159651b9e5872941be77b4e9b0df537ecb65517669f2d8257d97a9ae61cd51483f6212c110c9b63c3d7384e
@@ -14,6 +14,10 @@ Jekyll is a simple, blog-aware, static site generator perfect for personal, proj
14
14
 
15
15
  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.
16
16
 
17
+ ## Having trouble with OS X El Capitan?
18
+
19
+ See: http://jekyllrb.com/docs/troubleshooting/#jekyll-amp-mac-os-x-1011
20
+
17
21
  ## Getting Started
18
22
 
19
23
  * [Install](http://jekyllrb.com/docs/installation/) the gem
@@ -58,7 +58,6 @@ module Jekyll
58
58
  autoload :LogAdapter, 'jekyll/log_adapter'
59
59
  autoload :Page, 'jekyll/page'
60
60
  autoload :PluginManager, 'jekyll/plugin_manager'
61
- autoload :Post, 'jekyll/post'
62
61
  autoload :Publisher, 'jekyll/publisher'
63
62
  autoload :Reader, 'jekyll/reader'
64
63
  autoload :Regenerator, 'jekyll/regenerator'
@@ -49,7 +49,7 @@ module Jekyll
49
49
  conflicting_urls = false
50
50
  urls = {}
51
51
  urls = collect_urls(urls, site.pages, site.dest)
52
- urls = collect_urls(urls, site.posts, site.dest)
52
+ urls = collect_urls(urls, site.posts.docs, site.dest)
53
53
  urls.each do |url, paths|
54
54
  if paths.size > 1
55
55
  conflicting_urls = true
@@ -5,6 +5,11 @@ module Jekyll
5
5
  def initialize(config)
6
6
  require 'kramdown'
7
7
  @config = config
8
+ # If kramdown supported highlighter enabled, use that
9
+ highlighter = @config['highlighter']
10
+ if highlighter == 'rouge' || highlighter == 'coderay'
11
+ @config['kramdown']['syntax_highlighter'] ||= highlighter
12
+ end
8
13
  rescue LoadError
9
14
  STDERR.puts 'You are missing a library required for Markdown. Please run:'
10
15
  STDERR.puts ' $ [sudo] gem install kramdown'
@@ -109,7 +109,7 @@ module Jekyll
109
109
  #
110
110
  # Returns the converted content
111
111
  def render_liquid(content, payload, info, path)
112
- site.liquid_renderer.file(path).parse(content).render(payload, info)
112
+ site.liquid_renderer.file(path).parse(content).render!(payload, info)
113
113
  rescue Tags::IncludeTagError => e
114
114
  Jekyll.logger.error "Liquid Exception:", "#{e.message} in #{e.path}, included in #{path || self.path}"
115
115
  raise e
@@ -24,10 +24,11 @@ module Jekyll
24
24
  @collection = relations[:collection]
25
25
  @has_yaml_header = nil
26
26
 
27
- subdirs = relative_path.split(File::SEPARATOR).reject do |c|
28
- c.empty? || c.eql?(collection.relative_directory) || c.eql?("_drafts") || c.eql?(basename)
27
+ if draft?
28
+ categories_from_path("_drafts")
29
+ else
30
+ categories_from_path(collection.relative_directory)
29
31
  end
30
- merge_data!({'categories' => subdirs })
31
32
 
32
33
  data.default_proc = proc do |hash, key|
33
34
  site.frontmatter_defaults.find(relative_path, collection.label, key)
@@ -75,6 +76,15 @@ module Jekyll
75
76
  data['date'] ||= site.time
76
77
  end
77
78
 
79
+ # Returns whether the document is a draft. This is only the case if
80
+ # the document is in the 'posts' collection but in a different
81
+ # directory than '_posts'.
82
+ #
83
+ # Returns whether the document is a draft.
84
+ def draft?
85
+ data['draft'] ||= relative_path.index(collection.relative_directory).nil? && collection.label == "posts"
86
+ end
87
+
78
88
  # The path to the document, relative to the site source.
79
89
  #
80
90
  # Returns a String path which represents the relative path
@@ -176,7 +186,9 @@ module Jekyll
176
186
  path: cleaned_relative_path,
177
187
  output_ext: output_ext,
178
188
  name: Utils.slugify(basename_without_ext),
179
- title: Utils.slugify(data['slug']) || Utils.slugify(basename_without_ext),
189
+ title: Utils.slugify(data['slug'], mode: "pretty", cased: true) || Utils
190
+ .slugify(basename_without_ext, mode: "pretty", cased: true),
191
+ slug: Utils.slugify(data['slug']) || Utils.slugify(basename_without_ext),
180
192
  year: date.strftime("%Y"),
181
193
  month: date.strftime("%m"),
182
194
  day: date.strftime("%d"),
@@ -311,9 +323,21 @@ module Jekyll
311
323
  end
312
324
  end
313
325
 
326
+ # Add superdirectories of the special_dir to categories.
327
+ # In the case of es/_posts, 'es' is added as a category.
328
+ # In the case of _posts/es, 'es' is NOT added as a category.
329
+ #
330
+ # Returns nothing.
331
+ def categories_from_path(special_dir)
332
+ superdirs = relative_path.sub(/#{special_dir}(.*)/, '').split(File::SEPARATOR).reject do |c|
333
+ c.empty? || c.eql?(special_dir) || c.eql?(basename)
334
+ end
335
+ merge_data!({ 'categories' => superdirs })
336
+ end
337
+
314
338
  def populate_categories
315
339
  merge_data!({
316
- "categories" => (
340
+ 'categories' => (
317
341
  Array(data['categories']) + Utils.pluralized_array_from_hash(data, 'category', 'categories')
318
342
  ).map { |c| c.to_s }.flatten.uniq
319
343
  })
@@ -366,11 +390,10 @@ module Jekyll
366
390
  #
367
391
  # Returns -1, 0, +1 or nil depending on whether this doc's path is less than,
368
392
  # equal or greater than the other doc's path. See String#<=> for more details.
369
- def <=>(anotherDocument)
370
- cmp = data['date'] <=> anotherDocument.data['date']
371
- if 0 == cmp
372
- cmp = path <=> anotherDocument.path
373
- end
393
+ def <=>(other)
394
+ return nil if !other.respond_to?(:data)
395
+ cmp = data['date'] <=> other.data['date']
396
+ cmp = path <=> other.path if cmp == 0
374
397
  cmp
375
398
  end
376
399
 
@@ -45,7 +45,7 @@ module Jekyll
45
45
  # Returns the given filename or title as a lowercase URL String.
46
46
  # See Utils.slugify for more detail.
47
47
  def slugify(input, mode=nil)
48
- Utils.slugify(input, mode)
48
+ Utils.slugify(input, mode: mode)
49
49
  end
50
50
 
51
51
  # Format a date in short format e.g. "27 Jan 2011".
@@ -15,6 +15,7 @@ module Jekyll
15
15
  after_reset: [],
16
16
  post_read: [],
17
17
  pre_render: [],
18
+ post_render: [],
18
19
  post_write: [],
19
20
  },
20
21
  :pages => {
@@ -30,6 +31,7 @@ module Jekyll
30
31
  post_write: [],
31
32
  },
32
33
  :documents => {
34
+ post_init: [],
33
35
  pre_render: [],
34
36
  post_render: [],
35
37
  post_write: [],
@@ -130,7 +130,9 @@ module Jekyll
130
130
  #
131
131
  # Returns nothing.
132
132
  def write_metadata
133
- File.binwrite(metadata_file, Marshal.dump(metadata))
133
+ unless disabled?
134
+ File.binwrite(metadata_file, Marshal.dump(metadata))
135
+ end
134
136
  end
135
137
 
136
138
  # Produce the absolute path of the metadata file
@@ -179,6 +179,8 @@ module Jekyll
179
179
  page.render(layouts, payload)
180
180
  end
181
181
  end
182
+
183
+ Jekyll::Hooks.trigger :site, :post_render, self, payload
182
184
  rescue Errno::ENOENT
183
185
  # ignore missing layout dir
184
186
  end
@@ -121,10 +121,12 @@ module Jekyll
121
121
  #
122
122
  # string - the filename or title to slugify
123
123
  # mode - how string is slugified
124
+ # cased - whether to replace all uppercase letters with their
125
+ # lowercase counterparts
124
126
  #
125
- # When mode is "none", return the given string in lowercase.
127
+ # When mode is "none", return the given string.
126
128
  #
127
- # When mode is "raw", return the given string in lowercase,
129
+ # When mode is "raw", return the given string,
128
130
  # with every sequence of spaces characters replaced with a hyphen.
129
131
  #
130
132
  # When mode is "default" or nil, non-alphabetic characters are
@@ -133,6 +135,9 @@ module Jekyll
133
135
  # When mode is "pretty", some non-alphabetic characters (._~!$&'()+,;=@)
134
136
  # are not replaced with hyphen.
135
137
  #
138
+ # If cased is true, all uppercase letters in the result string are
139
+ # replaced with their lowercase counterparts.
140
+ #
136
141
  # Examples:
137
142
  # slugify("The _config.yml file")
138
143
  # # => "the-config-yml-file"
@@ -140,11 +145,17 @@ module Jekyll
140
145
  # slugify("The _config.yml file", "pretty")
141
146
  # # => "the-_config.yml-file"
142
147
  #
148
+ # slugify("The _config.yml file", "pretty", true)
149
+ # # => "The-_config.yml file"
150
+ #
143
151
  # Returns the slugified string.
144
- def slugify(string, mode=nil)
152
+ def slugify(string, mode: nil, cased: false)
145
153
  mode ||= 'default'
146
154
  return nil if string.nil?
147
- return string.downcase unless SLUGIFY_MODES.include?(mode)
155
+
156
+ unless SLUGIFY_MODES.include?(mode)
157
+ return cased ? string : string.downcase
158
+ end
148
159
 
149
160
  # Replace each character sequence with a hyphen
150
161
  re = case mode
@@ -158,13 +169,13 @@ module Jekyll
158
169
  SLUGIFY_PRETTY_REGEXP
159
170
  end
160
171
 
161
- string.
172
+ slug = string.
162
173
  # Strip according to the mode
163
174
  gsub(re, '-').
164
175
  # Remove leading/trailing hyphen
165
- gsub(/^\-|\-$/i, '').
166
- # Downcase
167
- downcase
176
+ gsub(/^\-|\-$/i, '')
177
+
178
+ cased ? slug : slug.downcase
168
179
  end
169
180
 
170
181
  # Add an appropriate suffix to template so that it matches the specified
@@ -1,3 +1,3 @@
1
1
  module Jekyll
2
- VERSION = '3.0.0'
2
+ VERSION = '3.0.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-27 00:00:00.000000000 Z
11
+ date: 2015-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: liquid
@@ -234,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
234
  version: '0'
235
235
  requirements: []
236
236
  rubyforge_project:
237
- rubygems_version: 2.2.3
237
+ rubygems_version: 2.2.5
238
238
  signing_key:
239
239
  specification_version: 2
240
240
  summary: A simple, blog aware, static site generator.