jekyll-zopfli 2.2.0 → 2.3.0
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 +6 -0
- data/lib/jekyll/zopfli/compressor.rb +10 -5
- data/lib/jekyll/zopfli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ede348b4764fd1471a53a10ecd1d58f21659d79762b760b58effd80aa5a26ab3
|
4
|
+
data.tar.gz: b7a82496a951c065a587803a44968b871723064971ec6ac8b7298c7b4a81fb9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42ab91d962c4ce463d5a269df96945cc5a2e82be848c872fb9fb57d061e4b72633d462b607a239e78e91ccbbdd91894f69ca5df5764f88ecd5a28b2b3695c454
|
7
|
+
data.tar.gz: e3c70b64606a4095f4b0c5e11098b76f0b37019de30ae8ecf0a99cd2ac011722a4bf7155cd29ef1e0832d325d5e233d418d40269df72ba7e1ccda293e0367ba5
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,12 @@
|
|
4
4
|
|
5
5
|
...
|
6
6
|
|
7
|
+
## 2.3.0 (2019-10-23) [☰](https://github.com/philnash/jekyll-zopfli/compare/v2.2.0...v2.3.0)
|
8
|
+
|
9
|
+
### Changed
|
10
|
+
|
11
|
+
- Fixed tests and actually replaces files when it is supposed to. Thanks @pat!
|
12
|
+
|
7
13
|
## 2.2.0 (2019-08-26) [☰](https://github.com/philnash/jekyll-zopfli/compare/v2.1.0...v2.2.0)
|
8
14
|
|
9
15
|
### Changed
|
@@ -25,7 +25,7 @@ module Jekyll
|
|
25
25
|
# @return void
|
26
26
|
def self.compress_site(site)
|
27
27
|
site.each_site_file do |file|
|
28
|
-
compress_file(file.destination(site.dest), extensions: zippable_extensions(site))
|
28
|
+
compress_file(file.destination(site.dest), extensions: zippable_extensions(site), replace_file: replace_files(site))
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -44,8 +44,8 @@ module Jekyll
|
|
44
44
|
# @return void
|
45
45
|
def self.compress_directory(dir, site)
|
46
46
|
extensions = zippable_extensions(site).join(',')
|
47
|
-
files = Dir.glob(dir + "
|
48
|
-
files.each { |file| compress_file(file, extensions: zippable_extensions(site)) }
|
47
|
+
files = Dir.glob(dir + "/**/*{#{extensions}}")
|
48
|
+
files.each { |file| compress_file(file, extensions: zippable_extensions(site), replace_file: replace_files(site)) }
|
49
49
|
end
|
50
50
|
|
51
51
|
##
|
@@ -60,7 +60,7 @@ module Jekyll
|
|
60
60
|
# @param file_name [String] The file name of the file we want to compress
|
61
61
|
# @param extensions [Array<String>] The extensions of files that will be
|
62
62
|
# compressed.
|
63
|
-
# @param replace_file [Boolean] Whether the
|
63
|
+
# @param replace_file [Boolean] Whether the original file should be
|
64
64
|
# replaced or written alongside the original with a `.gz` extension
|
65
65
|
#
|
66
66
|
# @return void
|
@@ -79,6 +79,11 @@ module Jekyll
|
|
79
79
|
def self.zippable_extensions(site)
|
80
80
|
site.config['zopfli'] && site.config['zopfli']['extensions'] || Jekyll::Zopfli::DEFAULT_CONFIG['extensions']
|
81
81
|
end
|
82
|
+
|
83
|
+
def self.replace_files(site)
|
84
|
+
replace_files = site.config.dig('zopfli', 'replace_files')
|
85
|
+
replace_files.nil? ? Jekyll::Zopfli::DEFAULT_CONFIG['replace_files'] : replace_files
|
86
|
+
end
|
82
87
|
end
|
83
88
|
end
|
84
|
-
end
|
89
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-zopfli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phil Nash
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|