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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d5cafe8da5e5446eff77b983e5510729b8ac8bf7cc92b803ca36965788af160
4
- data.tar.gz: 8a46015830d35dee9bdfaf5df9eb479008961fee97085b723de7cf7e5cfa572b
3
+ metadata.gz: 8172e88f158adfe6551dbb4a8ae68e80f763fba27731e31ece8ff0fc5d0a719e
4
+ data.tar.gz: 6beae5d5fdb79b6415a228c42e01635d2c4754af125777a42b5d8b0a18c764bc
5
5
  SHA512:
6
- metadata.gz: aa26f8c0e5ba918e2abc1a949f66851154a759687ff664d8b247c120d8ce034db2b8978e07fff7cd6e2e8ac03f4b66e4434a5711f7490250235d9b4718ad644c
7
- data.tar.gz: 3e60282940f5e72f3dfe6276daec65887bacb0f36face06147dc75a9cfb5ee1d8b5d96821581e226abfb7706548fb1937f465caca9400fb576d0091f2b932aa8
6
+ metadata.gz: cb128cddbb09c726a00c161bdcf71b5cfc8abab83e775b4f0a67f726934b09a06d4b7efde6a62dcc491034b76e6b1aa8bed9a78ed11f73d7615bb8e6ec4c1534
7
+ data.tar.gz: fbe0e380c74a92a511d532c2f8554b2fa649cf14c1f1380a8fc56622aba9a2ee4e5fc78999150a25846f4648685df36ac17b400f69b6b79cfe92da1e2875af02
@@ -1,7 +1,7 @@
1
1
  name: Release
2
2
 
3
3
  env:
4
- BRIDGETOWN_VERSION: 1.0.0.beta2
4
+ BRIDGETOWN_VERSION: 1.0.0
5
5
 
6
6
  on:
7
7
  push:
@@ -2,13 +2,17 @@
2
2
  name: RSpec
3
3
 
4
4
  env:
5
- BRIDGETOWN_VERSION: 1.0.0.beta2
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.beta1](https://github.com/bt-rb/bridgetown-minify-html/compare/v1.0.1...v2.0.0.beta1) (2022-01-28)
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
- ### Legacy
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
@@ -6,6 +6,5 @@ gemspec
6
6
  gem "bridgetown", ENV["BRIDGETOWN_VERSION"] if ENV["BRIDGETOWN_VERSION"]
7
7
 
8
8
  group :development, :test do
9
- gem "github_changelog_generator", "~> 1.15.2"
10
9
  gem "rubocop", "~> 0.81.0"
11
10
  end
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.15", "< 2.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 pages and documents.
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 |page|
35
- minify_page(page)
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 minify_page(page)
44
- return unless compressible?(page.destination)
43
+ def minify_resource(resource)
44
+ return unless compressible?(resource)
45
45
 
46
- page.output = compressor.compress(page.output)
46
+ resource.output = compressor.compress(resource.output)
47
47
  @minified_count += 1
48
48
  end
49
49
 
50
- def compressible?(destination)
51
- destination.respond_to?(:output_ext) &&
52
- [".html", ".svg", ".xml"].include?(destination.output_ext)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BridgetownMinifyHtml
4
- VERSION = "2.0.0.beta1"
4
+ VERSION = "2.0.0"
5
5
  end
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.beta1
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-01-28 00:00:00.000000000 Z
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: '0.15'
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: '0.15'
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: 1.3.1
169
+ version: '0'
170
170
  requirements: []
171
171
  rubygems_version: 3.2.3
172
172
  signing_key: