jekyll-template 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/jekyll-template.gemspec +0 -1
- data/lib/jekyll/template.rb +21 -24
- data/lib/jekyll/template/version.rb +1 -1
- metadata +1 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3333a130fc89923bfcda857c074206183bb3572d
|
4
|
+
data.tar.gz: 0b84993342b9be3575b41b1d3f3b827a9497f085
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4912b379f3e22658e3ce6d8028e54e9308faa0af1e4d13e38ebbf84e4f6dc05ddb81d0efa3e6952cf9aa382d352e0f8a7bd8dd77e158357c64a25cd35e0371a
|
7
|
+
data.tar.gz: 99dc2e76321450898e0b68cc54f6a4ec08d8dbe418a94f7690c40bb7dde471ef673673cbdda55e66b6686d598e97cce4d439faa2a4f25703f9af716bbd4472b5
|
data/jekyll-template.gemspec
CHANGED
@@ -23,7 +23,6 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_runtime_dependency("jekyll", ">= 3.1.2")
|
24
24
|
spec.add_runtime_dependency("htmlcompressor", "~> 0.3.1")
|
25
25
|
spec.add_runtime_dependency("unindent", "~> 1.0")
|
26
|
-
spec.add_runtime_dependency("yui-compressor", "0.12.0")
|
27
26
|
|
28
27
|
spec.add_development_dependency "bundler", "~> 1.13"
|
29
28
|
spec.add_development_dependency "rake", "~> 10.0"
|
data/lib/jekyll/template.rb
CHANGED
@@ -2,7 +2,6 @@ require "htmlcompressor"
|
|
2
2
|
require "jekyll"
|
3
3
|
require "jekyll/template/version"
|
4
4
|
require "unindent"
|
5
|
-
# require "yui-compressor"
|
6
5
|
|
7
6
|
module Jekyll
|
8
7
|
module Tags
|
@@ -57,10 +56,6 @@ module Jekyll
|
|
57
56
|
# Remove leading whitespace
|
58
57
|
# content = content.lstrip
|
59
58
|
compressor = HtmlCompressor::Compressor.new({
|
60
|
-
:compress_javascript => true,
|
61
|
-
:javascript_compressor => :yui,
|
62
|
-
:compress_css => true,
|
63
|
-
:css_compressor => :yui,
|
64
59
|
:remove_comments => true
|
65
60
|
})
|
66
61
|
site = context.registers[:site]
|
@@ -101,27 +96,15 @@ module Jekyll
|
|
101
96
|
end
|
102
97
|
end
|
103
98
|
|
104
|
-
content = parse_content(context, content)
|
105
|
-
|
106
|
-
# sanitize
|
107
|
-
# Determines whether to parse as HTML or markdown
|
108
|
-
unless @sanitize
|
109
|
-
converter = site.find_converter_instance(::Jekyll::Converters::Markdown)
|
110
|
-
content = content.to_s.unindent
|
111
|
-
content = converter.convert(content)
|
112
|
-
else
|
113
|
-
content = content.to_s.unindent
|
114
|
-
end
|
115
|
-
|
116
|
-
# setting the template content
|
99
|
+
content = sanitize(site, parse_content(context, content))
|
117
100
|
context["template"]["content"] = content
|
118
101
|
|
119
|
-
|
120
|
-
@output = template.render( context )
|
121
|
-
# normalizes whitespace and indentation
|
122
|
-
@output = compressor.compress(@output)
|
102
|
+
compressor.compress(template.render(context))
|
123
103
|
end
|
124
104
|
|
105
|
+
# update_attributes(data)
|
106
|
+
# Description: Merges data with @attributes.
|
107
|
+
# @param data { hash }
|
125
108
|
def update_attributes(data)
|
126
109
|
if data
|
127
110
|
@attributes = @attributes.merge(data)
|
@@ -172,8 +155,6 @@ module Jekyll
|
|
172
155
|
def get_template_content(template)
|
173
156
|
file_path = get_template_path(template)
|
174
157
|
path = File.read(file_path.strip)
|
175
|
-
# returns template content
|
176
|
-
path
|
177
158
|
end
|
178
159
|
|
179
160
|
# load_template(context)
|
@@ -204,6 +185,22 @@ module Jekyll
|
|
204
185
|
end
|
205
186
|
end
|
206
187
|
|
188
|
+
# sanitize(site, content)
|
189
|
+
# Description: Renders the content as markdown or HTML based on the
|
190
|
+
# "parse" attribute.
|
191
|
+
# Returns: Content (string).
|
192
|
+
# @param site { Jekyll site instance }
|
193
|
+
# @param content { string }
|
194
|
+
def sanitize(site, content)
|
195
|
+
unless @sanitize
|
196
|
+
converter = site.find_converter_instance(::Jekyll::Converters::Markdown)
|
197
|
+
content = content.to_s.unindent
|
198
|
+
content = converter.convert(content)
|
199
|
+
else
|
200
|
+
content = content.to_s.unindent
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
207
204
|
# unindent(content)
|
208
205
|
# Description: Removes initial indentation.
|
209
206
|
# Returns: Content (string).
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ItsJonQ
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: yui-compressor
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - '='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 0.12.0
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - '='
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 0.12.0
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: bundler
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|