jekyll-tilt 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a5406b43b234c4eab914cbe366a9dff2df7fd6d3a059aa4adb019f6a40fca6a
4
- data.tar.gz: 79a0f3c62d38cc1c8c784334d7e5dffefc7a7dda00a147f89ff12b809497c4f5
3
+ metadata.gz: 811b3a30af84ffb0fc66c59e7ea4742e3e4983b60e6b2d6641c38fd31789f5c9
4
+ data.tar.gz: b9735cb1c76144c46371d8c5cb87737f12153867335279ff6a8c133d7e5ab06d
5
5
  SHA512:
6
- metadata.gz: f4ddb00749e33513ae298072160ac6098a1e1f916ca3e6cbdd7ded615977209608eb6283aa73bba32128fc2f6512c196dc1c49fab83d62798e454e4fb7e2bf9f
7
- data.tar.gz: 303ad7a19090779ffb7240522dd2adb7c338eeb6e0105f515eb3f0fd450563a22849be6a197edcd6aac31437620f1d6d9b248d01b1bdf916c86804e146fe230d
6
+ metadata.gz: 31e2741ff792e59cf551c6fabaeeb8a1a3fa883f4539ab29aed2328d7ba0c1e4509ee5015edc57e56ed29d4b9add09bb91b5dd6a88bb161bd36a1298a2ff460e
7
+ data.tar.gz: fedec0f1b69a18991087dc28980b9e411422d45d90433ec119d540674b0376ca3663ed74fc7b81123ae7cc5e160c8afae65ce04988a65e80d87dcb3d8c7f1d67
data/Gemfile CHANGED
@@ -5,6 +5,7 @@
5
5
  # Encoding: utf-8
6
6
 
7
7
  source "https://rubygems.org"
8
+ ruby "~> 2.4"
8
9
  gemspec
9
10
 
10
11
  group :development do
data/lib/jekyll/tilt.rb CHANGED
@@ -20,7 +20,9 @@ module Jekyll
20
20
  def self.setup!
21
21
  Jekyll::Hooks.register(:site, :pre_render) { |s, _| convert_l!(s) }
22
22
  Jekyll::Hooks.register [:documents, :pages], :pre_render do |d, _|
23
- convert_d!(d)
23
+ convert_d!(d, {
24
+ site: d.site,
25
+ })
24
26
  end
25
27
  end
26
28
 
@@ -30,7 +32,9 @@ module Jekyll
30
32
  # --
31
33
  def self.convert_l!(site)
32
34
  site.layouts.each_value do |v|
33
- convert_d!(v)
35
+ convert_d!(v, {
36
+ site: site,
37
+ })
34
38
  end
35
39
  end
36
40
 
@@ -38,9 +42,13 @@ module Jekyll
38
42
  # Convert pages
39
43
  # @return [nil]
40
44
  # --
41
- def self.convert_d!(doc)
42
- doc.content = Processor.run_for(doc.content, {
43
- ext: doc.ext,
45
+ def self.convert_d!(page, site:)
46
+ page.content = Processor.run_for(page.content, {
47
+ ext: page.data["ext"] || page.ext,
48
+ var: {
49
+ page: page,
50
+ site: site,
51
+ },
44
52
  })
45
53
  end
46
54
 
@@ -47,9 +47,11 @@ module Jekyll
47
47
  # @param out [String] the content to output
48
48
  # @return [String]
49
49
  # --
50
- def self.run_for(out, ext:)
50
+ def self.run_for(out, ext:, var: {})
51
51
  find_for(ext).each do |v|
52
- out = v.run_for(out)
52
+ out = v.run_for(out, {
53
+ **var,
54
+ })
53
55
  end
54
56
 
55
57
  out
@@ -4,6 +4,6 @@
4
4
 
5
5
  module Jekyll
6
6
  module Tilt
7
- VERSION = "1.0.2"
7
+ VERSION = "1.0.3"
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-tilt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordon Bedwell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-19 00:00:00.000000000 Z
11
+ date: 2018-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec