bridgetown-minify-html 2.0.0.beta1 → 2.0.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/.github/workflows/release.yml +1 -1
- data/.github/workflows/rspec.yml +5 -1
- data/.github/workflows/rubocop.yml +5 -0
- data/CHANGELOG.md +4 -2
- data/Gemfile +0 -1
- data/README.md +1 -1
- data/bridgetown-minify-html.gemspec +1 -1
- data/lib/bridgetown-minify-html/minifier.rb +10 -9
- data/lib/bridgetown-minify-html/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8172e88f158adfe6551dbb4a8ae68e80f763fba27731e31ece8ff0fc5d0a719e
|
4
|
+
data.tar.gz: 6beae5d5fdb79b6415a228c42e01635d2c4754af125777a42b5d8b0a18c764bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb128cddbb09c726a00c161bdcf71b5cfc8abab83e775b4f0a67f726934b09a06d4b7efde6a62dcc491034b76e6b1aa8bed9a78ed11f73d7615bb8e6ec4c1534
|
7
|
+
data.tar.gz: fbe0e380c74a92a511d532c2f8554b2fa649cf14c1f1380a8fc56622aba9a2ee4e5fc78999150a25846f4648685df36ac17b400f69b6b79cfe92da1e2875af02
|
data/.github/workflows/rspec.yml
CHANGED
@@ -2,13 +2,17 @@
|
|
2
2
|
name: RSpec
|
3
3
|
|
4
4
|
env:
|
5
|
-
BRIDGETOWN_VERSION: 1.0.0
|
5
|
+
BRIDGETOWN_VERSION: 1.0.0
|
6
6
|
|
7
7
|
on:
|
8
8
|
push:
|
9
9
|
branches: [ main ]
|
10
10
|
pull_request:
|
11
11
|
|
12
|
+
concurrency:
|
13
|
+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
|
14
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
15
|
+
|
12
16
|
jobs:
|
13
17
|
test:
|
14
18
|
strategy:
|
@@ -5,6 +5,11 @@ on:
|
|
5
5
|
branches:
|
6
6
|
- main
|
7
7
|
pull_request:
|
8
|
+
|
9
|
+
concurrency:
|
10
|
+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
|
11
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
12
|
+
|
8
13
|
jobs:
|
9
14
|
build:
|
10
15
|
runs-on: ubuntu-latest
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## [2.0.0
|
3
|
+
## [2.0.0](https://github.com/bt-rb/bridgetown-minify-html/compare/v1.0.1...v2.0.0) (2022-05-25)
|
4
4
|
|
5
5
|
|
6
6
|
### ⚠ BREAKING CHANGES
|
@@ -10,11 +10,13 @@
|
|
10
10
|
### Bug Fixes
|
11
11
|
|
12
12
|
* Changelog was pushing to main not master ([#19](https://github.com/bt-rb/bridgetown-minify-html/issues/19)) ([5483b12](https://github.com/bt-rb/bridgetown-minify-html/commit/5483b1250b3c0035600ed8a3bab6d7512cc17a97))
|
13
|
+
* migrate to resource engine ([#35](https://github.com/bt-rb/bridgetown-minify-html/issues/35)) ([f8a62fb](https://github.com/bt-rb/bridgetown-minify-html/commit/f8a62fbd740138069240014f73f4156452c7bbe2))
|
13
14
|
* set required reuby version to >= 2.7 ([7171051](https://github.com/bt-rb/bridgetown-minify-html/commit/717105125bad53f0b574044cdda81d2ffa96038d))
|
14
15
|
* Upgrade to account for changes to [@site](https://github.com/site).pages and [@site](https://github.com/site).documents ([#25](https://github.com/bt-rb/bridgetown-minify-html/issues/25)) ([ed63a53](https://github.com/bt-rb/bridgetown-minify-html/commit/ed63a53686abc0b15298d6d84f70cfeff67e9287))
|
15
16
|
|
16
|
-
###
|
17
|
+
### Miscellaneous Chores
|
17
18
|
|
19
|
+
* release 2.0.0 ([b50495f](https://github.com/bt-rb/bridgetown-minify-html/commit/b50495f456fb9a1b623a885d34c1ed2165f1c7b7))
|
18
20
|
- Adjust Readme to center title & subtitle [\#23](https://github.com/bt-rb/bridgetown-minify-html/pull/23) ([MikeRogers0](https://github.com/MikeRogers0))
|
19
21
|
- Adding GitHub Action to autorelease when GitHub changes [\#22](https://github.com/bt-rb/bridgetown-minify-html/pull/22) ([MikeRogers0](https://github.com/MikeRogers0))
|
20
22
|
- Adding support for Ruby 3.0 [\#20](https://github.com/bt-rb/bridgetown-minify-html/pull/20) ([MikeRogers0](https://github.com/MikeRogers0))
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -28,7 +28,7 @@ bundle add bridgetown-minify-html -g bridgetown_plugins
|
|
28
28
|
|
29
29
|
## Usage
|
30
30
|
|
31
|
-
Once you've added the plugin, it'll automatically compress your outputted HTML without any additional configuration required
|
31
|
+
Once you've added the plugin, it'll automatically compress your outputted HTML without any additional configuration required when you run `bin/bridgetown build` or `bin/bridgetown deploy`.
|
32
32
|
|
33
33
|
### Optional configuration options
|
34
34
|
|
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
|
26
26
|
spec.required_ruby_version = ">= 2.7"
|
27
27
|
|
28
|
-
spec.add_dependency "bridgetown", ">= 0.
|
28
|
+
spec.add_dependency "bridgetown", ">= 1.0.0", "< 2.0"
|
29
29
|
spec.add_dependency "htmlcompressor", ">= 0.4", "< 1.0"
|
30
30
|
|
31
31
|
spec.add_development_dependency "bundler"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# This actually does the Minification. It gets passed the site object,
|
4
|
-
# then it'll just loop through all the
|
4
|
+
# then it'll just loop through all the resources.
|
5
5
|
module BridgetownMinifyHtml
|
6
6
|
class Minifier
|
7
7
|
DEFAULT_OPTIONS = {
|
@@ -31,8 +31,8 @@ module BridgetownMinifyHtml
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def call!
|
34
|
-
@site.resources.each do |
|
35
|
-
|
34
|
+
@site.resources.each do |resource|
|
35
|
+
minify_resource(resource)
|
36
36
|
end
|
37
37
|
|
38
38
|
Bridgetown.logger.info "Minify HTML:", "Complete, Processed #{@minified_count} file(s)"
|
@@ -40,16 +40,17 @@ module BridgetownMinifyHtml
|
|
40
40
|
|
41
41
|
private
|
42
42
|
|
43
|
-
def
|
44
|
-
return unless compressible?(
|
43
|
+
def minify_resource(resource)
|
44
|
+
return unless compressible?(resource)
|
45
45
|
|
46
|
-
|
46
|
+
resource.output = compressor.compress(resource.output)
|
47
47
|
@minified_count += 1
|
48
48
|
end
|
49
49
|
|
50
|
-
def compressible?(
|
51
|
-
destination.respond_to?(:output_ext)
|
52
|
-
|
50
|
+
def compressible?(resource)
|
51
|
+
return unless resource.destination.respond_to?(:output_ext)
|
52
|
+
|
53
|
+
[".html", ".svg", ".xml"].include?(resource.destination.output_ext)
|
53
54
|
end
|
54
55
|
|
55
56
|
def compressor
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bridgetown-minify-html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Rogers
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-05-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bridgetown
|
@@ -17,7 +17,7 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 1.0.0
|
21
21
|
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: '2.0'
|
@@ -27,7 +27,7 @@ dependencies:
|
|
27
27
|
requirements:
|
28
28
|
- - ">="
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version:
|
30
|
+
version: 1.0.0
|
31
31
|
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '2.0'
|
@@ -164,9 +164,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
164
164
|
version: '2.7'
|
165
165
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
166
|
requirements:
|
167
|
-
- - "
|
167
|
+
- - ">="
|
168
168
|
- !ruby/object:Gem::Version
|
169
|
-
version:
|
169
|
+
version: '0'
|
170
170
|
requirements: []
|
171
171
|
rubygems_version: 3.2.3
|
172
172
|
signing_key:
|