jekyll-template 0.17.0 → 0.17.1

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
  SHA1:
3
- metadata.gz: 24b0844ed4b74d2b03fc171c6331d7ddf8bee8a2
4
- data.tar.gz: c70da784a83f7e143482c1da7d7cf7cd11d0f5e2
3
+ metadata.gz: 8138c87f50815e04b0ed2f4187bcdbda0b218b22
4
+ data.tar.gz: 9ebfb51c82c29f3ef24fcd471e5385c11b354e3e
5
5
  SHA512:
6
- metadata.gz: bc44f9d82540ea8391c5bae3c0c65435b357d9e0b7b8bab334d2ba2ec284a25149a23b7ec14c383d1d83cbd588212735ae3a4fab759c2e7f5489002ab4a975eb
7
- data.tar.gz: 8f38cabf78922e11399d4adc59bf2d8a5c00c77e261468c3392187d7ce7ba334ae0617be4a84e0222402db42204c0ea89c8769e1e8a8d3eded699c2317f98329
6
+ metadata.gz: c3b2fa68ca9df5afd0a722f914a2a0b1a2a8429d9d0bcf6d6bb4b4c834f013c5d64c5846e1c43b0986a3dc3753477b9b3169ff5420b3beb376f9011330d88f24
7
+ data.tar.gz: 32570bb0328ea75deee663be4b5d64f5eb0001c429df479b8d0d2820f3a1d724245a90f28632e0231c12adee0560cba05cf8f7ca0ab5f5085ec63df5e2b39149
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Template
3
- VERSION = "0.17.0"
3
+ VERSION = "0.17.1"
4
4
  end
5
5
  end
@@ -53,10 +53,7 @@ module Jekyll
53
53
 
54
54
  add_template_to_dependency(@template_name, context)
55
55
 
56
- template_obj = load_cached_template(@template_name, context)
57
- update_attributes(template_obj["data"])
58
-
59
- template = template_obj["template"]
56
+ template = load_cached_template(@template_name, context)
60
57
 
61
58
  # Define the default template attributes
62
59
  # Source:
@@ -114,11 +111,13 @@ module Jekyll
114
111
  context.registers[:cached_templates] ||= {}
115
112
  cached_templates = context.registers[:cached_templates]
116
113
 
117
- if cached_templates.key?(path)
118
- cached_templates[path]
119
- else
114
+ unless cached_templates.key?(path)
120
115
  cached_templates[path] = load_template()
121
116
  end
117
+ template = cached_templates[path]
118
+
119
+ update_attributes(template["data"])
120
+ template["template"]
122
121
  end
123
122
 
124
123
  # get_template_path(path)
@@ -133,7 +132,7 @@ module Jekyll
133
132
  # Returns: Template content
134
133
  # @param template { string }
135
134
  def get_template_content(template)
136
- path = File.read(get_template_path(template).strip)
135
+ File.read(get_template_path(template).strip)
137
136
  end
138
137
 
139
138
  # load_template()
@@ -169,9 +168,9 @@ module Jekyll
169
168
  def sanitize(content)
170
169
  unless @sanitize
171
170
  converter = @site.find_converter_instance(::Jekyll::Converters::Markdown)
172
- content = converter.convert(unindent(content))
171
+ converter.convert(unindent(content))
173
172
  else
174
- content = unindent(content)
173
+ unindent(content)
175
174
  end
176
175
  end
177
176
 
@@ -199,15 +198,11 @@ module Jekyll
199
198
  def get_front_matter(content)
200
199
  # Strip leading white-spaces
201
200
  content = unindent(content)
202
- data = Hash.new
203
201
  if content =~ YAML_FRONT_MATTER_REGEXP
204
202
  front_matter = Regexp.last_match(0)
205
- # Push YAML data to the template's attributes
206
203
  values = SafeYAML.load(front_matter)
207
- # Set YAML data to @attributes
208
- data.merge!(values)
209
- # Returns data
210
- data
204
+ else
205
+ Hash.new
211
206
  end
212
207
  end
213
208
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-template
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.17.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ItsJonQ
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-15 00:00:00.000000000 Z
11
+ date: 2017-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll