jekyll 3.1.0.pre.rc1 → 3.1.0.pre.rc2

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: 5da26c7d190e158f8259ccab996f37dbdeab27f6
4
- data.tar.gz: 78d017c3d93a9a91ba2ada36ab1f3522c72d7b16
3
+ metadata.gz: 0c49c2ade7b29eeb1b1928c794846db916363241
4
+ data.tar.gz: 5713d975ac97f85c1d5cda5a4377ef8d71765268
5
5
  SHA512:
6
- metadata.gz: cd566922d0e9b2f8e6e5cba893ed419d304b0e250145800d455a5e3eac66dfb6de3ce123535f76bc68600e7dfa999ab9f4759af207181b1a82c918f7b2db3d6f
7
- data.tar.gz: 0d0d806095422d586cc4775197b897130ae36e0eb550d0d5b71c5503b1c2e34004d1530f9a5fbebf3a53837b7a4571494c2665ed98a786416e1d1c22a27be10e
6
+ metadata.gz: e4a476d032971178d64c3ab1087bedcaa16cfaf96c6b232d9a8461f8ed9f4db087e8af6b5691bdb2ece34e42facfdc083240fde62286c7d3fba06d0e08e8a8bd
7
+ data.tar.gz: d3b03199417ca5da4d536f30fd5d9fbd8f782acca115c613cacfdda6f74f9bb725fb7fe79658050c4c267ba2f72405f7e7d4ce24780495618c8ec8df1984a97c
@@ -97,13 +97,7 @@ module Jekyll
97
97
  # Returns the String extension for the output file.
98
98
  # e.g. ".html" for an HTML output file.
99
99
  def output_ext
100
- if converters.all? { |c| c.is_a?(Jekyll::Converters::Identity) }
101
- ext
102
- else
103
- converters.map do |c|
104
- c.output_ext(ext) unless c.is_a?(Jekyll::Converters::Identity)
105
- end.compact.last
106
- end
100
+ Jekyll::Renderer.new(site, self).output_ext
107
101
  end
108
102
 
109
103
  # Determine which converter to use based on this convertible's
@@ -59,7 +59,10 @@ module Jekyll
59
59
  end
60
60
  Utils.deep_merge_hashes!(data, other)
61
61
  if data.key?('date') && !data['date'].is_a?(Time)
62
- data['date'] = Utils.parse_date(data['date'].to_s, "Document '#{relative_path}' does not have a valid date in the YAML front matter.")
62
+ data['date'] = Utils.parse_date(
63
+ data['date'].to_s,
64
+ "Document '#{relative_path}' does not have a valid date in the YAML front matter."
65
+ )
63
66
  end
64
67
  data
65
68
  end
data/lib/jekyll/page.rb CHANGED
@@ -7,6 +7,8 @@ module Jekyll
7
7
  attr_accessor :name, :ext, :basename
8
8
  attr_accessor :data, :content, :output
9
9
 
10
+ alias_method :extname, :ext
11
+
10
12
  # Attributes for Liquid templates
11
13
  ATTRIBUTES_FOR_LIQUID = %w(
12
14
  content
@@ -160,5 +162,13 @@ module Jekyll
160
162
  def index?
161
163
  basename == 'index'
162
164
  end
165
+
166
+ def trigger_hooks(hook_name, *args)
167
+ Jekyll::Hooks.trigger :pages, hook_name, self, *args
168
+ end
169
+
170
+ def write?
171
+ true
172
+ end
163
173
  end
164
174
  end
@@ -22,11 +22,7 @@ module Jekyll
22
22
  #
23
23
  # Returns the output extname including the leading period.
24
24
  def output_ext
25
- @output_ext ||= if document.permalink
26
- File.extname(document.permalink)
27
- else
28
- converters.first.output_ext(document.extname)
29
- end
25
+ @output_ext ||= (permalink_ext || converter_output_ext)
30
26
  end
31
27
 
32
28
  ######################
@@ -38,10 +34,18 @@ module Jekyll
38
34
 
39
35
  payload["page"] = document.to_liquid
40
36
 
41
- if document.collection.label == 'posts' && document.is_a?(Document)
37
+ if document.respond_to? :pager
38
+ payload["paginator"] = document.pager.to_liquid
39
+ end
40
+
41
+ if document.is_a?(Document) && document.collection.label == 'posts'
42
42
  payload['site']['related_posts'] = document.related_posts
43
43
  end
44
44
 
45
+ # render and transform content (this becomes the final content of the object)
46
+ payload['highlighter_prefix'] = converters.first.highlighter_prefix
47
+ payload['highlighter_suffix'] = converters.first.highlighter_suffix
48
+
45
49
  Jekyll.logger.debug "Pre-Render Hooks:", document.relative_path
46
50
  document.trigger_hooks(:pre_render, payload)
47
51
 
@@ -50,10 +54,6 @@ module Jekyll
50
54
  :registers => { :site => site, :page => payload['page'] }
51
55
  }
52
56
 
53
- # render and transform content (this becomes the final content of the object)
54
- payload['highlighter_prefix'] = converters.first.highlighter_prefix
55
- payload['highlighter_suffix'] = converters.first.highlighter_suffix
56
-
57
57
  output = document.content
58
58
 
59
59
  if document.render_with_liquid?
@@ -164,5 +164,28 @@ module Jekyll
164
164
 
165
165
  output
166
166
  end
167
+
168
+ private
169
+
170
+ def permalink_ext
171
+ if document.permalink
172
+ permalink_ext = File.extname(document.permalink)
173
+ permalink_ext unless permalink_ext.empty?
174
+ end
175
+ end
176
+
177
+ def converter_output_ext
178
+ if output_exts.size == 1
179
+ output_exts.last
180
+ else
181
+ output_exts[-2]
182
+ end
183
+ end
184
+
185
+ def output_exts
186
+ @output_exts ||= converters.map do |c|
187
+ c.output_ext(document.extname)
188
+ end.compact
189
+ end
167
190
  end
168
191
  end
data/lib/jekyll/site.rb CHANGED
@@ -176,7 +176,8 @@ module Jekyll
176
176
 
177
177
  pages.flatten.each do |page|
178
178
  if regenerator.regenerate?(page)
179
- page.render(layouts, payload)
179
+ page.output = Jekyll::Renderer.new(self, page, payload).run
180
+ page.trigger_hooks(:post_render)
180
181
  end
181
182
  end
182
183
 
@@ -1,3 +1,3 @@
1
1
  module Jekyll
2
- VERSION = '3.1.0.pre.rc1'
2
+ VERSION = '3.1.0.pre.rc2'
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.1.0.pre.rc1
4
+ version: 3.1.0.pre.rc2
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-16 00:00:00.000000000 Z
11
+ date: 2016-01-18 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.5.1
247
+ rubygems_version: 2.2.5
248
248
  signing_key:
249
249
  specification_version: 2
250
250
  summary: A simple, blog aware, static site generator.