octopress-minify-html 1.2.0 → 1.2.1
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/CHANGELOG.md +4 -0
- data/lib/octopress-minify-html/version.rb +1 -1
- data/lib/octopress-minify-html.rb +8 -53
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66f77e6b6bb79662f053933158b6d2fed390df9b
|
4
|
+
data.tar.gz: af0050be86b438969992080bebe54fd8b1ddce08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 030746768af211227b1e5e810621ff6b0da078f7d1510364a728584a83222c318fa94a8764190f5df3ffe12144e72b200fa6c3fdc0d34d1abeff26067dc4ecfe
|
7
|
+
data.tar.gz: dd2b2fbc4e4dafde8824955f955e240b8663a70c84ddc5cf0a85bbb2914ff956892a5eb3df9412585508330f4fcb1225d4463a2e24f68e6cab39815b3a55e88b
|
data/CHANGELOG.md
CHANGED
@@ -1,63 +1,18 @@
|
|
1
1
|
require 'html_press'
|
2
|
+
require 'octopress-hooks'
|
2
3
|
require 'octopress-minify-html/version'
|
3
4
|
|
4
5
|
module Octopress
|
5
6
|
module MinifyHTML
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
f.write(content)
|
7
|
+
class MinifyPage < Hooks::All
|
8
|
+
def post_render(item)
|
9
|
+
item.output = HtmlPress.press(item.output) if minify?(item.site.config)
|
10
10
|
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.output_html(config, path, content)
|
14
|
-
minify = config['minify_html']
|
15
|
-
production = config['env'].nil? || config['env'] =~ /production/i
|
16
|
-
if minify || (minify.nil? && production)
|
17
|
-
content = HtmlPress.press(content)
|
18
|
-
end
|
19
|
-
output_file(path, content)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
module Jekyll
|
25
|
-
class Post
|
26
|
-
def write(dest)
|
27
|
-
dest_path = destination(dest)
|
28
|
-
Octopress::MinifyHTML.output_html(@site.config, dest_path, output)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
class Page
|
33
|
-
def write(dest)
|
34
|
-
dest_path = destination(dest)
|
35
|
-
if File.extname(dest_path).downcase == '.html'
|
36
|
-
Octopress::MinifyHTML.output_html(@site.config, dest_path, output)
|
37
|
-
else
|
38
|
-
Octopress::MinifyHTML.output_file(@site.config, dest_path, output)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
class ConvertiblePage
|
44
|
-
def write(dest)
|
45
|
-
dest_path = destination(dest)
|
46
|
-
if File.extname(dest_path).downcase == '.html'
|
47
|
-
Octopress::MinifyHTML.output_html(@site.config, dest_path, output)
|
48
|
-
else
|
49
|
-
Octopress::MinifyHTML.output_file(@site.config, dest_path, output)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
11
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
Octopress::MinifyHTML.output_html(@site.config, dest_path, output)
|
59
|
-
else
|
60
|
-
Octopress::MinifyHTML.output_file(@site.config, dest_path, output)
|
12
|
+
def minify?(config)
|
13
|
+
minify = config['minify_html']
|
14
|
+
production = config['env'].nil? || config['env'] =~ /production/i
|
15
|
+
minify || (minify.nil? && production)
|
61
16
|
end
|
62
17
|
end
|
63
18
|
end
|
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.1
|
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-01-
|
11
|
+
date: 2015-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.8'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: octopress-hooks
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
description: Minify Jekyll's HTML output using html_press
|
84
98
|
email:
|
85
99
|
- brandon@imathis.com
|