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 +4 -4
- data/lib/jekyll/template/version.rb +1 -1
- data/lib/jekyll/template.rb +11 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8138c87f50815e04b0ed2f4187bcdbda0b218b22
|
4
|
+
data.tar.gz: 9ebfb51c82c29f3ef24fcd471e5385c11b354e3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3b2fa68ca9df5afd0a722f914a2a0b1a2a8429d9d0bcf6d6bb4b4c834f013c5d64c5846e1c43b0986a3dc3753477b9b3169ff5420b3beb376f9011330d88f24
|
7
|
+
data.tar.gz: 32570bb0328ea75deee663be4b5d64f5eb0001c429df479b8d0d2820f3a1d724245a90f28632e0231c12adee0560cba05cf8f7ca0ab5f5085ec63df5e2b39149
|
data/lib/jekyll/template.rb
CHANGED
@@ -53,10 +53,7 @@ module Jekyll
|
|
53
53
|
|
54
54
|
add_template_to_dependency(@template_name, context)
|
55
55
|
|
56
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
171
|
+
converter.convert(unindent(content))
|
173
172
|
else
|
174
|
-
|
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
|
-
|
208
|
-
|
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.
|
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-
|
11
|
+
date: 2017-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|