jekyll 3.1.0.pre.rc2 → 3.1.0.pre.rc3
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 +4 -4
- data/README.markdown +13 -6
- data/lib/jekyll/commands/build.rb +3 -1
- data/lib/jekyll/document.rb +33 -20
- data/lib/jekyll/drops/drop.rb +1 -1
- data/lib/jekyll/page.rb +1 -2
- data/lib/jekyll/site.rb +1 -1
- data/lib/jekyll/utils.rb +10 -0
- data/lib/jekyll/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2865d808960f9a984948e2dd85a597a69f5c4a44
|
4
|
+
data.tar.gz: c2d0d0269e460efde60e26ae58950640740d4f7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52b008307fc6b72f72ab63690691ec39d521abd6505a6ef7e2d96745fc4876b4389daa9947850e04b1be4457d4701378240f13642aa6f80f24a67ef9a4482ba4
|
7
|
+
data.tar.gz: 537a7719b68d684c382e3a2b521518269bcfd14384bff5eb5da724e4b75278adce25cd0c620c922e8044bfd8bfc7be614813e5cea660cc6ad1a8dca3a47063d9
|
data/README.markdown
CHANGED
@@ -1,11 +1,18 @@
|
|
1
1
|
# [Jekyll](http://jekyllrb.com/)
|
2
2
|
|
3
|
-
[![Gem Version](https://img.shields.io/gem/v/jekyll.svg)]
|
4
|
-
[![Build Status](https://
|
5
|
-
[![
|
6
|
-
[![
|
7
|
-
[![Dependency Status](https://gemnasium.com/jekyll/jekyll.svg)]
|
8
|
-
[![Security](https://hakiri.io/github/jekyll/jekyll/master.svg)]
|
3
|
+
[![Gem Version](https://img.shields.io/gem/v/jekyll.svg)][ruby-gems]
|
4
|
+
[![Build Status](https://travis-ci.org/jekyll/jekyll.svg?branch=master)][travis]
|
5
|
+
[![Test Coverage](https://codeclimate.com/github/jekyll/jekyll/badges/coverage.svg)][coverage]
|
6
|
+
[![Code Climate](https://codeclimate.com/github/jekyll/jekyll/badges/gpa.svg)][codeclimate]
|
7
|
+
[![Dependency Status](https://gemnasium.com/jekyll/jekyll.svg)][gemnasium]
|
8
|
+
[![Security](https://hakiri.io/github/jekyll/jekyll/master.svg)][hakiri]
|
9
|
+
|
10
|
+
[ruby-gems]: https://rubygems.org/gems/jekyll
|
11
|
+
[gemnasium]: https://gemnasium.com/jekyll/jekyll
|
12
|
+
[codeclimate]: https://codeclimate.com/github/jekyll/jekyll
|
13
|
+
[coverage]: https://codeclimate.com/github/jekyll/jekyll/coverage
|
14
|
+
[hakiri]: https://hakiri.io/github/jekyll/jekyll/master
|
15
|
+
[travis]: https://travis-ci.org/jekyll/jekyll
|
9
16
|
|
10
17
|
By Tom Preston-Werner, Nick Quaranto, Parker Moore, and many [awesome contributors](https://github.com/jekyll/jekyll/graphs/contributors)!
|
11
18
|
|
@@ -33,7 +33,9 @@ module Jekyll
|
|
33
33
|
build(site, options)
|
34
34
|
end
|
35
35
|
|
36
|
-
if options.fetch('
|
36
|
+
if options.fetch('detach', false)
|
37
|
+
Jekyll.logger.info "Auto-regeneration:", "disabled when running server detached."
|
38
|
+
elsif options.fetch('watch', false)
|
37
39
|
watch(site, options)
|
38
40
|
else
|
39
41
|
Jekyll.logger.info "Auto-regeneration:", "disabled. Use --watch to enable."
|
data/lib/jekyll/document.rb
CHANGED
@@ -8,7 +8,7 @@ module Jekyll
|
|
8
8
|
attr_accessor :content, :output
|
9
9
|
|
10
10
|
YAML_FRONT_MATTER_REGEXP = /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
|
11
|
-
DATELESS_FILENAME_MATCHER = /^(.*)(\.[^.]+)$/
|
11
|
+
DATELESS_FILENAME_MATCHER = /^(.+\/)*(.*)(\.[^.]+)$/
|
12
12
|
DATE_FILENAME_MATCHER = /^(.+\/)*(\d+-\d+-\d+)-(.*)(\.[^.]+)$/
|
13
13
|
|
14
14
|
# Create a new Document.
|
@@ -50,7 +50,7 @@ module Jekyll
|
|
50
50
|
# Merge some data in with this document's data.
|
51
51
|
#
|
52
52
|
# Returns the merged data.
|
53
|
-
def merge_data!(other)
|
53
|
+
def merge_data!(other, source: "YAML front matter")
|
54
54
|
if other.key?('categories') && !other['categories'].nil?
|
55
55
|
if other['categories'].is_a?(String)
|
56
56
|
other['categories'] = other['categories'].split(" ").map(&:strip)
|
@@ -61,7 +61,7 @@ module Jekyll
|
|
61
61
|
if data.key?('date') && !data['date'].is_a?(Time)
|
62
62
|
data['date'] = Utils.parse_date(
|
63
63
|
data['date'].to_s,
|
64
|
-
"Document '#{relative_path}' does not have a valid date in the
|
64
|
+
"Document '#{relative_path}' does not have a valid date in the #{source}."
|
65
65
|
)
|
66
66
|
end
|
67
67
|
data
|
@@ -267,40 +267,46 @@ module Jekyll
|
|
267
267
|
else
|
268
268
|
begin
|
269
269
|
defaults = @site.frontmatter_defaults.all(url, collection.label.to_sym)
|
270
|
-
merge_data!(defaults) unless defaults.empty?
|
270
|
+
merge_data!(defaults, source: "front matter defaults") unless defaults.empty?
|
271
271
|
|
272
272
|
self.content = File.read(path, merged_file_read_opts(opts))
|
273
273
|
if content =~ YAML_FRONT_MATTER_REGEXP
|
274
274
|
self.content = $POSTMATCH
|
275
275
|
data_file = SafeYAML.load(Regexp.last_match(1))
|
276
|
-
merge_data!(data_file) if data_file
|
276
|
+
merge_data!(data_file, source: "YAML front matter") if data_file
|
277
277
|
end
|
278
278
|
|
279
279
|
post_read
|
280
280
|
rescue SyntaxError => e
|
281
|
-
|
281
|
+
Jekyll.logger.error "Error:", "YAML Exception reading #{path}: #{e.message}"
|
282
282
|
rescue Exception => e
|
283
|
-
|
283
|
+
if e.is_a? Jekyll::Errors::FatalException
|
284
|
+
raise e
|
285
|
+
end
|
286
|
+
Jekyll.logger.error "Error:", "could not read file #{path}: #{e.message}"
|
284
287
|
end
|
285
288
|
end
|
286
289
|
end
|
287
290
|
|
288
291
|
def post_read
|
289
|
-
if
|
290
|
-
|
291
|
-
|
292
|
-
"
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
data['title'] ||= slug.split('-').select(&:capitalize).join(' ')
|
292
|
+
if relative_path =~ DATE_FILENAME_MATCHER
|
293
|
+
date, slug, ext = $2, $3, $4
|
294
|
+
if !data['date'] || data['date'].to_i == site.time.to_i
|
295
|
+
merge_data!({"date" => date}, source: "filename")
|
296
|
+
end
|
297
|
+
elsif relative_path =~ DATELESS_FILENAME_MATCHER
|
298
|
+
slug, ext = $2, $3
|
297
299
|
end
|
300
|
+
|
301
|
+
# Try to ensure the user gets a title.
|
302
|
+
data["title"] ||= Utils.titleize_slug(slug)
|
303
|
+
# Only overwrite slug & ext if they aren't specified.
|
304
|
+
data['slug'] ||= slug
|
305
|
+
data['ext'] ||= ext
|
306
|
+
|
298
307
|
populate_categories
|
299
308
|
populate_tags
|
300
|
-
|
301
|
-
if generate_excerpt?
|
302
|
-
data['excerpt'] ||= Jekyll::Excerpt.new(self)
|
303
|
-
end
|
309
|
+
generate_excerpt
|
304
310
|
end
|
305
311
|
|
306
312
|
# Add superdirectories of the special_dir to categories.
|
@@ -312,7 +318,7 @@ module Jekyll
|
|
312
318
|
superdirs = relative_path.sub(/#{special_dir}(.*)/, '').split(File::SEPARATOR).reject do |c|
|
313
319
|
c.empty? || c.eql?(special_dir) || c.eql?(basename)
|
314
320
|
end
|
315
|
-
merge_data!({ 'categories' => superdirs })
|
321
|
+
merge_data!({ 'categories' => superdirs }, source: "file path")
|
316
322
|
end
|
317
323
|
|
318
324
|
def populate_categories
|
@@ -437,5 +443,12 @@ module Jekyll
|
|
437
443
|
super
|
438
444
|
end
|
439
445
|
end
|
446
|
+
|
447
|
+
private # :nodoc:
|
448
|
+
def generate_excerpt
|
449
|
+
if generate_excerpt?
|
450
|
+
data["excerpt"] ||= Jekyll::Excerpt.new(self)
|
451
|
+
end
|
452
|
+
end
|
440
453
|
end
|
441
454
|
end
|
data/lib/jekyll/drops/drop.rb
CHANGED
data/lib/jekyll/page.rb
CHANGED
data/lib/jekyll/site.rb
CHANGED
@@ -225,7 +225,7 @@ module Jekyll
|
|
225
225
|
# Build a hash map based on the specified post attribute ( post attr =>
|
226
226
|
# array of posts ) then sort each array in reverse order.
|
227
227
|
hash = Hash.new { |h, key| h[key] = [] }
|
228
|
-
posts.docs.each { |p| p.data[post_attr].each { |t| hash[t] << p } }
|
228
|
+
posts.docs.each { |p| p.data[post_attr].each { |t| hash[t] << p } if p.data[post_attr] }
|
229
229
|
hash.values.each { |posts| posts.sort!.reverse! }
|
230
230
|
hash
|
231
231
|
end
|
data/lib/jekyll/utils.rb
CHANGED
@@ -10,10 +10,20 @@ module Jekyll
|
|
10
10
|
SLUGIFY_DEFAULT_REGEXP = Regexp.new('[^[:alnum:]]+').freeze
|
11
11
|
SLUGIFY_PRETTY_REGEXP = Regexp.new("[^[:alnum:]._~!$&'()+,;=@]+").freeze
|
12
12
|
|
13
|
+
# Takes an indented string and removes the preceding spaces on each line
|
14
|
+
|
13
15
|
def strip_heredoc(str)
|
14
16
|
str.gsub(/^[ \t]{#{(str.scan(/^[ \t]*(?=\S)/).min || "").size}}/, "")
|
15
17
|
end
|
16
18
|
|
19
|
+
# Takes a slug and turns it into a simple title.
|
20
|
+
|
21
|
+
def titleize_slug(slug)
|
22
|
+
slug.split("-").map! do |val|
|
23
|
+
val.capitalize!
|
24
|
+
end.join(" ")
|
25
|
+
end
|
26
|
+
|
17
27
|
# Non-destructive version of deep_merge_hashes! See that method.
|
18
28
|
#
|
19
29
|
# Returns the merged hashes.
|
data/lib/jekyll/version.rb
CHANGED
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.1.0.pre.
|
4
|
+
version: 3.1.0.pre.rc3
|
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: 2016-01-
|
11
|
+
date: 2016-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|
@@ -244,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
244
244
|
version: 1.3.1
|
245
245
|
requirements: []
|
246
246
|
rubyforge_project:
|
247
|
-
rubygems_version: 2.
|
247
|
+
rubygems_version: 2.5.1
|
248
248
|
signing_key:
|
249
249
|
specification_version: 2
|
250
250
|
summary: A simple, blog aware, static site generator.
|