jekyll-minifier 0.1.8 → 0.1.9
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/README.md +1 -1
- data/lib/jekyll-minifier.rb +3 -3
- data/spec/fixtures/_layouts/default.html +1 -1
- data/spec/fixtures/assets/js/script.js +4 -0
- data/spec/jekyll-minifier_spec.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1a6245b043d0258670069a682586cebd962bfa2e3f2bc309983fe5a7af43c5f
|
4
|
+
data.tar.gz: ae646b7490b07d6d807f5a8eb598614ded4c6d428ad201eeb129812983b0fad5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eef57564f407f07c5f1d18ef53f70123861d518d538f23ed3eb24614d706d4aa63f2e0cb721b42b56ab2b668bcc1bd72eef83613580c898b67261d33f5270776
|
7
|
+
data.tar.gz: 88f3ae6eca8a2437a79e2ebf2d63fba98e96da80e3c318bf111493245b0bfdda2b1aead5ed03e5ee9de430dacc37452d271b9af01c6bb33e09bf960e643bb40a
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ This was created due to the previous minifier (jekyll-press) not being CSS3 comp
|
|
8
8
|
|
9
9
|
Note: this is my first ever gem, I'm learning, so feedback is much appreciated.
|
10
10
|
|
11
|
-
** This minifier now only runs when JEKYLL_ENV="production" is set in the
|
11
|
+
** This minifier now only runs when JEKYLL_ENV="production" is set in the environment **
|
12
12
|
|
13
13
|
Easy to use, just install the jekyll-minifier gem:
|
14
14
|
|
data/lib/jekyll-minifier.rb
CHANGED
@@ -39,7 +39,7 @@ module Jekyll
|
|
39
39
|
if ( !opts.nil? )
|
40
40
|
# Javascript Arguments
|
41
41
|
js_args += opts[:uglifier_args] if opts.has_key?(:uglifier_args)
|
42
|
-
|
42
|
+
|
43
43
|
# HTML Arguments
|
44
44
|
html_args[:remove_spaces_inside_tags] = opts['remove_spaces_inside_tags'] if opts.has_key?('remove_spaces_inside_tags')
|
45
45
|
html_args[:remove_multi_spaces] = opts['remove_multi_spaces'] if opts.has_key?('remove_multi_spaces')
|
@@ -63,7 +63,7 @@ module Jekyll
|
|
63
63
|
html_args[:preserve_patterns] += [/<\?php.*?\?>/im] if opts['preserve_php'] == true
|
64
64
|
html_args[:preserve_patterns] += opts[:preserve_patterns].map { |pattern| Regexp.new(pattern)} if opts.has_key?(:preserve_patterns)
|
65
65
|
end
|
66
|
-
|
66
|
+
|
67
67
|
html_args[:css_compressor] = CSSminify2.new()
|
68
68
|
|
69
69
|
if ( !js_args.nil? )
|
@@ -95,7 +95,7 @@ module Jekyll
|
|
95
95
|
compressor = Uglifier.new()
|
96
96
|
end
|
97
97
|
|
98
|
-
output_file(path,
|
98
|
+
output_file(path, compressor.compile(content))
|
99
99
|
else
|
100
100
|
output_file(path, content)
|
101
101
|
end
|
@@ -19,7 +19,7 @@ layout: null
|
|
19
19
|
<!--[if lt IE 9]><script src="//cdn.jsdelivr.net/g/html5shiv@3.7.3,respond@1.4.2" crossorigin="anonymous"></script><![endif]-->
|
20
20
|
<link rel="stylesheet" href="{{ site.baseurl | prepend: site.url }}/assets/css/style.css">
|
21
21
|
<link rel="alternate" type="application/atom+xml" title="Example.com" href="{{ site.baseurl | prepend: site.url }}/atom.xml">
|
22
|
-
|
22
|
+
<script type="text/javascript" src="{{ site.baseurl | prepend: site.url }}/assets/js/script.js"></script>
|
23
23
|
</head>
|
24
24
|
<body class="layout-reverse sidebar-overlay">
|
25
25
|
{% include sidebar.html %}
|
@@ -22,6 +22,8 @@ describe "JekyllMinifier" do
|
|
22
22
|
let(:site) { Jekyll::Site.new(config) }
|
23
23
|
let(:context) { make_context(site: site) }
|
24
24
|
before(:each) do
|
25
|
+
allow(ENV).to receive(:[]).and_call_original
|
26
|
+
allow(ENV).to receive(:[]).with('JEKYLL_ENV').and_return('production')
|
25
27
|
site.process
|
26
28
|
end
|
27
29
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-minifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DigitalSparky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -150,6 +150,7 @@ files:
|
|
150
150
|
- spec/fixtures/_posts/2013-04-03-test-review-2.markdown
|
151
151
|
- spec/fixtures/_posts/2015-01-01-random.markdown
|
152
152
|
- spec/fixtures/assets/css/style.css
|
153
|
+
- spec/fixtures/assets/js/script.js
|
153
154
|
- spec/fixtures/atom.xml
|
154
155
|
- spec/fixtures/index.html
|
155
156
|
- spec/jekyll-minifier_spec.rb
|
@@ -191,6 +192,7 @@ test_files:
|
|
191
192
|
- spec/fixtures/_posts/2013-04-03-test-review-2.markdown
|
192
193
|
- spec/fixtures/_posts/2015-01-01-random.markdown
|
193
194
|
- spec/fixtures/assets/css/style.css
|
195
|
+
- spec/fixtures/assets/js/script.js
|
194
196
|
- spec/fixtures/atom.xml
|
195
197
|
- spec/fixtures/index.html
|
196
198
|
- spec/jekyll-minifier_spec.rb
|