Redo origin
This commit is contained in:
parent
77e68a05a2
commit
11bd9c2c4d
@ -67,11 +67,3 @@ jekyll-minifier:
|
|||||||
harmony: true
|
harmony: true
|
||||||
|
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
|
|
||||||
# Like my stuff?
|
|
||||||
|
|
||||||
Would you like to buy me a coffee or send me a tip?
|
|
||||||
While it's not expected, I would really appreciate it.
|
|
||||||
|
|
||||||
[![Paypal](https://www.paypalobjects.com/webstatic/mktg/Logo/pp-logo-100px.png)](https://paypal.me/MattSpurrier) <a href="https://www.buymeacoffee.com/digitalsparky" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/white_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
|
|
||||||
|
@ -34,6 +34,7 @@ module Jekyll
|
|||||||
end
|
end
|
||||||
|
|
||||||
def output_html(path, content)
|
def output_html(path, content)
|
||||||
|
if ( ENV['JEKYLL_ENV'] == "production" )
|
||||||
html_args = { remove_comments: true, compress_css: true, compress_javascript: true, preserve_patterns: [] }
|
html_args = { remove_comments: true, compress_css: true, compress_javascript: true, preserve_patterns: [] }
|
||||||
js_args = {}
|
js_args = {}
|
||||||
|
|
||||||
@ -63,7 +64,7 @@ module Jekyll
|
|||||||
html_args[:simple_boolean_attributes] = opts['simple_boolean_attributes'] if opts.has_key?('simple_boolean_attributes')
|
html_args[:simple_boolean_attributes] = opts['simple_boolean_attributes'] if opts.has_key?('simple_boolean_attributes')
|
||||||
html_args[:compress_js_templates] = opts['compress_js_templates'] if opts.has_key?('compress_js_templates')
|
html_args[:compress_js_templates] = opts['compress_js_templates'] if opts.has_key?('compress_js_templates')
|
||||||
html_args[:preserve_patterns] += [/<\?php.*?\?>/im] if opts['preserve_php'] == true
|
html_args[:preserve_patterns] += [/<\?php.*?\?>/im] if opts['preserve_php'] == true
|
||||||
html_args[:preserve_patterns] += opts['preserve_patterns'].map { |pattern| Regexp.new(pattern)} if opts.has_key?('preserve_patterns')
|
html_args[:preserve_patterns] += opts[:preserve_patterns].map { |pattern| Regexp.new(pattern)} if opts.has_key?(:preserve_patterns)
|
||||||
end
|
end
|
||||||
|
|
||||||
html_args[:css_compressor] = CSSminify2.new()
|
html_args[:css_compressor] = CSSminify2.new()
|
||||||
@ -76,9 +77,13 @@ module Jekyll
|
|||||||
|
|
||||||
compressor = HtmlCompressor::Compressor.new(html_args)
|
compressor = HtmlCompressor::Compressor.new(html_args)
|
||||||
output_file(path, compressor.compress(content))
|
output_file(path, compressor.compress(content))
|
||||||
|
else
|
||||||
|
output_file(path, content)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def output_js(path, content)
|
def output_js(path, content)
|
||||||
|
if ( ENV['JEKYLL_ENV'] == "production" )
|
||||||
js_args = {}
|
js_args = {}
|
||||||
opts = @site.config['jekyll-minifier']
|
opts = @site.config['jekyll-minifier']
|
||||||
compress = true
|
compress = true
|
||||||
@ -98,9 +103,13 @@ module Jekyll
|
|||||||
else
|
else
|
||||||
output_file(path, content)
|
output_file(path, content)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
output_file(path, content)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def output_json(path, content)
|
def output_json(path, content)
|
||||||
|
if ( ENV['JEKYLL_ENV'] == "production" )
|
||||||
opts = @site.config['jekyll-minifier']
|
opts = @site.config['jekyll-minifier']
|
||||||
compress = true
|
compress = true
|
||||||
if ( !opts.nil? )
|
if ( !opts.nil? )
|
||||||
@ -112,9 +121,13 @@ module Jekyll
|
|||||||
else
|
else
|
||||||
output_file(path, content)
|
output_file(path, content)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
output_file(path, content)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def output_css(path, content)
|
def output_css(path, content)
|
||||||
|
if ( ENV['JEKYLL_ENV'] == "production" )
|
||||||
opts = @site.config['jekyll-minifier']
|
opts = @site.config['jekyll-minifier']
|
||||||
compress = true
|
compress = true
|
||||||
if ( !opts.nil? )
|
if ( !opts.nil? )
|
||||||
@ -126,6 +139,9 @@ module Jekyll
|
|||||||
else
|
else
|
||||||
output_file(path, content)
|
output_file(path, content)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
output_file(path, content)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
module Jekyll
|
module Jekyll
|
||||||
module Minifier
|
module Minifier
|
||||||
VERSION = "0.1.8"
|
#VERSION = "0.1.8"
|
||||||
|
VERSION = "0.1.11"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user