jekyll-template 0.13.0 → 0.14.0

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: e013575787d42d5bf3d04ad9ed76a2861acc6d81
4
- data.tar.gz: dceaec276853cfb9746c19d305433e3bfd9b4943
3
+ metadata.gz: 3333a130fc89923bfcda857c074206183bb3572d
4
+ data.tar.gz: 0b84993342b9be3575b41b1d3f3b827a9497f085
5
5
  SHA512:
6
- metadata.gz: 0eb97c37686edffa5abfa10a024d70fc7c51c12f68b260d13ee99e7df46ca691e9a18c71f4242b4fa376251160563be5d7406eb4967c9539b093cf615e25a323
7
- data.tar.gz: c509c21c2bac6aafe952c193a8a0b668924486a1ef8e1013eea967edd7cfbd452cfef7ece2d7b46b0050bd9ec60ac907a3a44ccae6f3cca6060e0cf5b8799a1e
6
+ metadata.gz: b4912b379f3e22658e3ce6d8028e54e9308faa0af1e4d13e38ebbf84e4f6dc05ddb81d0efa3e6952cf9aa382d352e0f8a7bd8dd77e158357c64a25cd35e0371a
7
+ data.tar.gz: 99dc2e76321450898e0b68cc54f6a4ec08d8dbe418a94f7690c40bb7dde471ef673673cbdda55e66b6686d598e97cce4d439faa2a4f25703f9af716bbd4472b5
@@ -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"
@@ -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
- # rendering the template with the content
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).
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Template
3
- VERSION = "0.13.0"
3
+ VERSION = "0.14.0"
4
4
  end
5
5
  end
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.13.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