octopress-minify-html 1.2.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +13 -1
- data/lib/octopress-minify-html.rb +15 -1
- data/lib/octopress-minify-html/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37f6dee141459023fd18c66d76b04fee3662f7be
|
4
|
+
data.tar.gz: 4a82e978dfaf3beada51da06894b940b8e5d792c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ddb37c757afc52dc99a5333fbaa2ad2f2d28a5cf9fde019e24691189b316e28886156ef9ddbee17d0c9aedd99b04b85560652a712c4cb59d7c92a1210cf82e0
|
7
|
+
data.tar.gz: bb4ab60002aac4bf8fc4bcb9110fc374b0ef85738a8bb4dfd5a11f63a9b2c70c6c730c1301d7764dd98813c106fc3afd424156feb5ba281afbc346498eced1dc
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
[![Build Status](https://travis-ci.org/octopress/minify-html.png)](https://travis-ci.org/octopress/minify-html)
|
5
5
|
|
6
6
|
|
7
|
-
Minify Jekyll's HTML output with [
|
7
|
+
Minify Jekyll's HTML output with [HtmlPress](https://github.com/stereobooster/html_press)
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
@@ -45,6 +45,18 @@ For example, this will disable minification, regardless of your `env` setting.
|
|
45
45
|
minify_html: false
|
46
46
|
```
|
47
47
|
|
48
|
+
## HtmlPress Configuration:
|
49
|
+
|
50
|
+
You can set configuration options for [HtmlPress](https://github.com/stereobooster/html_press) in your Jekyll configuration like this:
|
51
|
+
|
52
|
+
```
|
53
|
+
html_press:
|
54
|
+
unquoted_attributes: false
|
55
|
+
drop_empty_values: false
|
56
|
+
strip_crlf: false
|
57
|
+
js_minifier_options: false
|
58
|
+
```
|
59
|
+
|
48
60
|
## Contributing
|
49
61
|
|
50
62
|
1. Fork it
|
@@ -6,7 +6,8 @@ module Octopress
|
|
6
6
|
module MinifyHTML
|
7
7
|
class MinifyPage < Hooks::All
|
8
8
|
def post_render(item)
|
9
|
-
|
9
|
+
options = MinifyHTML.symbolize(item.site.config['html_press'] || {})
|
10
|
+
item.output = HtmlPress.press(item.output, options) if minify?(item)
|
10
11
|
end
|
11
12
|
|
12
13
|
def minify?(item)
|
@@ -21,9 +22,22 @@ module Octopress
|
|
21
22
|
end
|
22
23
|
end
|
23
24
|
end
|
25
|
+
|
26
|
+
def self.symbolize(obj)
|
27
|
+
return obj.reduce({}) do |memo, (k, v)|
|
28
|
+
memo.tap { |m| m[k.to_sym] = symbolize(v) }
|
29
|
+
end if obj.is_a? Hash
|
30
|
+
|
31
|
+
return obj.reduce([]) do |memo, v|
|
32
|
+
memo << symbolize(v); memo
|
33
|
+
end if obj.is_a? Array
|
34
|
+
|
35
|
+
obj
|
36
|
+
end
|
24
37
|
end
|
25
38
|
end
|
26
39
|
|
40
|
+
|
27
41
|
if defined? Octopress::Docs
|
28
42
|
Octopress::Docs.add({
|
29
43
|
name: "Octopress Minify HTML",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopress-minify-html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: octopress-debugger
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|