bridgetown-minify-html 1.0.0 → 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 +43 -0
- data/.github/workflows/rspec.yml +10 -14
- data/.github/workflows/rubocop.yml +9 -14
- data/CHANGELOG.md +53 -22
- data/CODE_OF_CONDUCT.md +1 -1
- data/Gemfile +4 -0
- data/LICENSE +1 -1
- data/README.md +23 -8
- data/bridgetown-minify-html.gemspec +7 -8
- data/lib/bridgetown-minify-html/minifier.rb +10 -8
- data/lib/bridgetown-minify-html/version.rb +1 -1
- metadata +19 -22
- data/.github/dependabot.yml +0 -21
- data/.github/workflows/changelog.yml +0 -40
- data/.github/workflows/gempush.yml +0 -18
- data/.github/workflows/spelling.yml +0 -22
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
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
env:
|
|
4
|
+
BRIDGETOWN_VERSION: 1.0.0
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
jobs:
|
|
11
|
+
release-please:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: GoogleCloudPlatform/release-please-action@v3
|
|
15
|
+
id: release
|
|
16
|
+
with:
|
|
17
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
18
|
+
release-type: ruby
|
|
19
|
+
package-name: bridgetown-minify-html
|
|
20
|
+
bump-minor-pre-major: true
|
|
21
|
+
version-file: "lib/bridgetown-minify-html/version.rb"
|
|
22
|
+
- uses: actions/checkout@v2
|
|
23
|
+
if: ${{ steps.release.outputs.release_created }}
|
|
24
|
+
- uses: ruby/setup-ruby@v1
|
|
25
|
+
with:
|
|
26
|
+
ruby-version: 3.0.0
|
|
27
|
+
if: ${{ steps.release.outputs.release_created }}
|
|
28
|
+
- run: |
|
|
29
|
+
gem install bundler -v 2.2.16
|
|
30
|
+
bundle install
|
|
31
|
+
bundle exec rake
|
|
32
|
+
if: ${{ steps.release.outputs.release_created }}
|
|
33
|
+
- name: release gem
|
|
34
|
+
run: |
|
|
35
|
+
mkdir -p $HOME/.gem
|
|
36
|
+
touch $HOME/.gem/credentials
|
|
37
|
+
chmod 0600 $HOME/.gem/credentials
|
|
38
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
|
39
|
+
gem build *.gemspec
|
|
40
|
+
gem push *.gem
|
|
41
|
+
env:
|
|
42
|
+
GEM_HOST_API_KEY: "${{secrets.GEM_HOST_API_KEY}}"
|
|
43
|
+
if: ${{ steps.release.outputs.release_created }}
|
data/.github/workflows/rspec.yml
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: RSpec
|
|
3
3
|
|
|
4
|
+
env:
|
|
5
|
+
BRIDGETOWN_VERSION: 1.0.0
|
|
6
|
+
|
|
4
7
|
on:
|
|
5
8
|
push:
|
|
6
|
-
branches: [
|
|
9
|
+
branches: [ main ]
|
|
7
10
|
pull_request:
|
|
8
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
|
+
|
|
9
16
|
jobs:
|
|
10
17
|
test:
|
|
11
18
|
strategy:
|
|
12
19
|
fail-fast: false
|
|
13
20
|
matrix:
|
|
14
|
-
ruby: [2.
|
|
21
|
+
ruby: [2.7, 3.0, head]
|
|
15
22
|
runs-on: ubuntu-latest
|
|
16
23
|
name: Test against Ruby ${{ matrix.ruby }}
|
|
17
24
|
|
|
@@ -20,18 +27,7 @@ jobs:
|
|
|
20
27
|
- uses: ruby/setup-ruby@v1
|
|
21
28
|
with:
|
|
22
29
|
ruby-version: ${{ matrix.ruby }}
|
|
23
|
-
|
|
24
|
-
uses: actions/cache@v2.1.2
|
|
25
|
-
with:
|
|
26
|
-
path: vendor/bundle
|
|
27
|
-
key: ${{ runner.os }}-ruby-${{ matrix.ruby }}-${{ hashFiles('**/Gemfile.lock') }}
|
|
28
|
-
restore-keys: |
|
|
29
|
-
${{ runner.os }}-ruby-${{ matrix.ruby }}
|
|
30
|
-
- name: Install Gems
|
|
31
|
-
run: |
|
|
32
|
-
gem install bundler
|
|
33
|
-
bundle config path vendor/bundle
|
|
34
|
-
bundle install --jobs 4 --retry 3
|
|
30
|
+
bundler-cache: true
|
|
35
31
|
- name: Run tests
|
|
36
32
|
run: |
|
|
37
33
|
bundle exec rake spec
|
|
@@ -3,28 +3,23 @@ name: RuboCop
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
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
|
|
11
16
|
|
|
12
17
|
steps:
|
|
13
18
|
- uses: actions/checkout@v2
|
|
14
|
-
- name: Set up Ruby
|
|
19
|
+
- name: Set up Ruby 3.0
|
|
15
20
|
uses: ruby/setup-ruby@v1
|
|
16
21
|
with:
|
|
17
|
-
ruby-version:
|
|
18
|
-
|
|
19
|
-
uses: actions/cache@v2.1.1
|
|
20
|
-
with:
|
|
21
|
-
path: vendor/bundle
|
|
22
|
-
key: ${{ runner.os }}-rubocop-${{ hashFiles('**/Gemfile.lock') }}
|
|
23
|
-
restore-keys: |
|
|
24
|
-
${{ runner.os }}-rubocop-
|
|
25
|
-
- name: Install gems
|
|
26
|
-
run: |
|
|
27
|
-
bundle config path vendor/bundle
|
|
28
|
-
bundle install --jobs 4 --retry 3
|
|
22
|
+
ruby-version: 3.0
|
|
23
|
+
bundler-cache: true
|
|
29
24
|
- name: Run RuboCop
|
|
30
25
|
run: bundle exec rubocop --parallel
|
data/CHANGELOG.md
CHANGED
|
@@ -1,44 +1,75 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [
|
|
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
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* Upgrade to account for changes to @site.pages and @site.documents (#25)
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
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))
|
|
14
|
+
* set required reuby version to >= 2.7 ([7171051](https://github.com/bt-rb/bridgetown-minify-html/commit/717105125bad53f0b574044cdda81d2ffa96038d))
|
|
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))
|
|
16
|
+
|
|
17
|
+
### Miscellaneous Chores
|
|
18
|
+
|
|
19
|
+
* release 2.0.0 ([b50495f](https://github.com/bt-rb/bridgetown-minify-html/commit/b50495f456fb9a1b623a885d34c1ed2165f1c7b7))
|
|
20
|
+
- Adjust Readme to center title & subtitle [\#23](https://github.com/bt-rb/bridgetown-minify-html/pull/23) ([MikeRogers0](https://github.com/MikeRogers0))
|
|
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))
|
|
22
|
+
- Adding support for Ruby 3.0 [\#20](https://github.com/bt-rb/bridgetown-minify-html/pull/20) ([MikeRogers0](https://github.com/MikeRogers0))
|
|
23
|
+
- Fix: Changelog was pushing to main not master [\#19](https://github.com/bt-rb/bridgetown-minify-html/pull/19) ([MikeRogers0](https://github.com/MikeRogers0))
|
|
24
|
+
|
|
25
|
+
## [v1.0.1](https://github.com/bt-rb/bridgetown-minify-html/tree/v1.0.1) (2020-12-02)
|
|
26
|
+
|
|
27
|
+
[Full Changelog](https://github.com/bt-rb/bridgetown-minify-html/compare/v1.0.0...v1.0.1)
|
|
28
|
+
|
|
29
|
+
**Merged pull requests:**
|
|
30
|
+
|
|
31
|
+
- Updating owner references [\#18](https://github.com/bt-rb/bridgetown-minify-html/pull/18) ([MikeRogers0](https://github.com/MikeRogers0))
|
|
32
|
+
- Removing docker from Dependabot checks [\#17](https://github.com/bt-rb/bridgetown-minify-html/pull/17) ([MikeRogers0](https://github.com/MikeRogers0))
|
|
33
|
+
|
|
34
|
+
## [v1.0.0](https://github.com/bt-rb/bridgetown-minify-html/tree/v1.0.0) (2020-10-22)
|
|
35
|
+
|
|
36
|
+
[Full Changelog](https://github.com/bt-rb/bridgetown-minify-html/compare/v0.2.0...v1.0.0)
|
|
6
37
|
|
|
7
38
|
**Merged pull requests:**
|
|
8
39
|
|
|
9
|
-
- Bumping to 1.0.0 [\#16](https://github.com/
|
|
10
|
-
- Using GitHub Action by @jstastny for gempush [\#15](https://github.com/
|
|
11
|
-
- Testing against multiple ruby versions [\#14](https://github.com/
|
|
12
|
-
- Adding funding\_uri & metadata in [\#13](https://github.com/
|
|
13
|
-
- Adding new badges to the readme [\#12](https://github.com/
|
|
14
|
-
- Cleaning up GitHub Actions [\#11](https://github.com/
|
|
15
|
-
- Ditching docker [\#10](https://github.com/
|
|
16
|
-
- Bump actions/setup-ruby from v1.1.1 to v1.1.2 [\#9](https://github.com/
|
|
40
|
+
- Bumping to 1.0.0 [\#16](https://github.com/bt-rb/bridgetown-minify-html/pull/16) ([MikeRogers0](https://github.com/MikeRogers0))
|
|
41
|
+
- Using GitHub Action by @jstastny for gempush [\#15](https://github.com/bt-rb/bridgetown-minify-html/pull/15) ([MikeRogers0](https://github.com/MikeRogers0))
|
|
42
|
+
- Testing against multiple ruby versions [\#14](https://github.com/bt-rb/bridgetown-minify-html/pull/14) ([MikeRogers0](https://github.com/MikeRogers0))
|
|
43
|
+
- Adding funding\_uri & metadata in [\#13](https://github.com/bt-rb/bridgetown-minify-html/pull/13) ([MikeRogers0](https://github.com/MikeRogers0))
|
|
44
|
+
- Adding new badges to the readme [\#12](https://github.com/bt-rb/bridgetown-minify-html/pull/12) ([MikeRogers0](https://github.com/MikeRogers0))
|
|
45
|
+
- Cleaning up GitHub Actions [\#11](https://github.com/bt-rb/bridgetown-minify-html/pull/11) ([MikeRogers0](https://github.com/MikeRogers0))
|
|
46
|
+
- Ditching docker [\#10](https://github.com/bt-rb/bridgetown-minify-html/pull/10) ([MikeRogers0](https://github.com/MikeRogers0))
|
|
47
|
+
- Bump actions/setup-ruby from v1.1.1 to v1.1.2 [\#9](https://github.com/bt-rb/bridgetown-minify-html/pull/9) ([dependabot[bot]](https://github.com/apps/dependabot))
|
|
17
48
|
|
|
18
|
-
## [v0.2.0](https://github.com/
|
|
49
|
+
## [v0.2.0](https://github.com/bt-rb/bridgetown-minify-html/tree/v0.2.0) (2020-07-22)
|
|
19
50
|
|
|
20
|
-
[Full Changelog](https://github.com/
|
|
51
|
+
[Full Changelog](https://github.com/bt-rb/bridgetown-minify-html/compare/v0.1.0...v0.2.0)
|
|
21
52
|
|
|
22
53
|
**Fixed bugs:**
|
|
23
54
|
|
|
24
|
-
- bug: undefined local variable or method extension [\#8](https://github.com/
|
|
25
|
-
- bug: Bridgetown::StaticFile don't have output\_ext - so ignoring them [\#7](https://github.com/
|
|
26
|
-
- fix: Making sure changelog is regenerated on release [\#4](https://github.com/
|
|
55
|
+
- bug: undefined local variable or method extension [\#8](https://github.com/bt-rb/bridgetown-minify-html/pull/8) ([MikeRogers0](https://github.com/MikeRogers0))
|
|
56
|
+
- bug: Bridgetown::StaticFile don't have output\_ext - so ignoring them [\#7](https://github.com/bt-rb/bridgetown-minify-html/pull/7) ([MikeRogers0](https://github.com/MikeRogers0))
|
|
57
|
+
- fix: Making sure changelog is regenerated on release [\#4](https://github.com/bt-rb/bridgetown-minify-html/pull/4) ([MikeRogers0](https://github.com/MikeRogers0))
|
|
27
58
|
|
|
28
59
|
**Merged pull requests:**
|
|
29
60
|
|
|
30
|
-
- feat: Rewording test titles [\#6](https://github.com/
|
|
31
|
-
- chores: Adding rubygems badge in [\#5](https://github.com/
|
|
32
|
-
- Update rake requirement from ~\> 12.0 to ~\> 13.0 [\#2](https://github.com/
|
|
33
|
-
- Bump actions/setup-ruby from v1 to v1.1.1 [\#1](https://github.com/
|
|
61
|
+
- feat: Rewording test titles [\#6](https://github.com/bt-rb/bridgetown-minify-html/pull/6) ([MikeRogers0](https://github.com/MikeRogers0))
|
|
62
|
+
- chores: Adding rubygems badge in [\#5](https://github.com/bt-rb/bridgetown-minify-html/pull/5) ([MikeRogers0](https://github.com/MikeRogers0))
|
|
63
|
+
- Update rake requirement from ~\> 12.0 to ~\> 13.0 [\#2](https://github.com/bt-rb/bridgetown-minify-html/pull/2) ([dependabot[bot]](https://github.com/apps/dependabot))
|
|
64
|
+
- Bump actions/setup-ruby from v1 to v1.1.1 [\#1](https://github.com/bt-rb/bridgetown-minify-html/pull/1) ([dependabot[bot]](https://github.com/apps/dependabot))
|
|
34
65
|
|
|
35
|
-
## [v0.1.0](https://github.com/
|
|
66
|
+
## [v0.1.0](https://github.com/bt-rb/bridgetown-minify-html/tree/v0.1.0) (2020-07-20)
|
|
36
67
|
|
|
37
|
-
[Full Changelog](https://github.com/
|
|
68
|
+
[Full Changelog](https://github.com/bt-rb/bridgetown-minify-html/compare/5ce9f22631f178ecf164501e7d28d6dee902ce9c...v0.1.0)
|
|
38
69
|
|
|
39
70
|
**Implemented enhancements:**
|
|
40
71
|
|
|
41
|
-
- Preparing for 0.1.0 release [\#3](https://github.com/
|
|
72
|
+
- Preparing for 0.1.0 release [\#3](https://github.com/bt-rb/bridgetown-minify-html/pull/3) ([MikeRogers0](https://github.com/MikeRogers0))
|
|
42
73
|
|
|
43
74
|
|
|
44
75
|
|
data/CODE_OF_CONDUCT.md
CHANGED
|
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
|
|
|
55
55
|
## Enforcement
|
|
56
56
|
|
|
57
57
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
-
reported by contacting the project team at
|
|
58
|
+
reported by contacting the project team at support@andrewm.codes. All
|
|
59
59
|
complaints will be reviewed and investigated and will result in a response that
|
|
60
60
|
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
61
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
data/Gemfile
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
[](https://badge.fury.io/rb/bridgetown-minify-html)
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
Bridgetown Minify HTML
|
|
3
|
+
</h1>
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a target="_blank" rel="noopener noreferrer" href="https://badge.fury.io/rb/bridgetown-minify-html">
|
|
7
|
+
<img src="https://badge.fury.io/rb/bridgetown-minify-html.svg" alt="Gem Version" style="max-width:100%;">
|
|
8
|
+
</a>
|
|
9
|
+
<a target="_blank" rel="noopener noreferrer" href="https://github.com/bt-rb/bridgetown-minify-html/workflows/RSpec/badge.svg">
|
|
10
|
+
<img src="https://github.com/bt-rb/bridgetown-minify-html/workflows/RSpec/badge.svg" alt="RSpec" style="max-width:100%;">
|
|
11
|
+
</a>
|
|
12
|
+
<a target="_blank" rel="noopener noreferrer" href="https://github.com/bt-rb/bridgetown-minify-html/workflows/RuboCop/badge.svg">
|
|
13
|
+
<img src="https://github.com/bt-rb/bridgetown-minify-html/workflows/RuboCop/badge.svg" alt="RuboCop" style="max-width:100%;">
|
|
14
|
+
</a>
|
|
15
|
+
</p>
|
|
7
16
|
|
|
8
|
-
|
|
17
|
+
<p align="center">
|
|
18
|
+
A Bridgetown plugin to Minify your outputted HTML.
|
|
19
|
+
</p>
|
|
9
20
|
|
|
10
21
|
## Installation
|
|
11
22
|
|
|
@@ -17,7 +28,7 @@ bundle add bridgetown-minify-html -g bridgetown_plugins
|
|
|
17
28
|
|
|
18
29
|
## Usage
|
|
19
30
|
|
|
20
|
-
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`.
|
|
21
32
|
|
|
22
33
|
### Optional configuration options
|
|
23
34
|
|
|
@@ -52,9 +63,13 @@ minify_html:
|
|
|
52
63
|
|
|
53
64
|
## Contributing
|
|
54
65
|
|
|
55
|
-
1. Fork it (https://github.com/
|
|
66
|
+
1. Fork it (https://github.com/bt-rb/bridgetown-minify-html/fork)
|
|
56
67
|
2. Clone the fork using `git clone` to your local development machine.
|
|
57
68
|
3. Create your feature branch (`git checkout -b feature/my-new-feature`)
|
|
58
69
|
4. Commit your changes (`git commit -am 'Add some feature'`)
|
|
59
70
|
5. Push to the branch (`git push origin my-new-feature`)
|
|
60
71
|
6. Create a new Pull Request
|
|
72
|
+
|
|
73
|
+
## 💌 In Loving Memory of Mike Rogers
|
|
74
|
+
|
|
75
|
+
[Mike Rogers](https://github.com/MikeRogers0) was the creator of `bridgetown-minify-html` and participated in the project from July 2020 until his passing in November 2021. This project is maintained by [@andrewmcodes](https://github.com/andrewmcodes) in his honor. You can find Mike's obituary [here if you'd like to leave a message.](https://www.mykeeper.com/profile/MikeRogers/)
|
|
@@ -5,28 +5,27 @@ require_relative "lib/bridgetown-minify-html/version"
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = "bridgetown-minify-html"
|
|
7
7
|
spec.version = BridgetownMinifyHtml::VERSION
|
|
8
|
-
spec.
|
|
9
|
-
spec.email = "
|
|
8
|
+
spec.authors = ["Mike Rogers", "Andrew Mason"]
|
|
9
|
+
spec.email = "support@andrewm.codes"
|
|
10
10
|
spec.summary = "Minify Outputted HTML in Bridgetown"
|
|
11
|
-
spec.homepage = "https://github.com/
|
|
11
|
+
spec.homepage = "https://github.com/bt-rb/bridgetown-minify-html"
|
|
12
12
|
spec.license = "MIT"
|
|
13
13
|
|
|
14
14
|
spec.metadata = {
|
|
15
15
|
'bug_tracker_uri' => "#{spec.homepage}/issues",
|
|
16
|
-
|
|
16
|
+
"changelog_uri" => "#{spec.homepage}/blob/main/CHANGELOG.md",
|
|
17
17
|
'documentation_uri' => spec.homepage,
|
|
18
18
|
'homepage_uri' => spec.homepage,
|
|
19
|
-
|
|
20
|
-
'funding_uri' => 'https://www.buymeacoffee.com/MikeRogers0'
|
|
19
|
+
"source_code_uri" => spec.homepage
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r!^(test|script|spec|features|frontend)/!) }
|
|
24
23
|
spec.test_files = spec.files.grep(%r!^spec/!)
|
|
25
24
|
spec.require_paths = ["lib"]
|
|
26
25
|
|
|
27
|
-
spec.required_ruby_version = ">= 2.
|
|
26
|
+
spec.required_ruby_version = ">= 2.7"
|
|
28
27
|
|
|
29
|
-
spec.add_dependency "bridgetown", ">= 0.
|
|
28
|
+
spec.add_dependency "bridgetown", ">= 1.0.0", "< 2.0"
|
|
30
29
|
spec.add_dependency "htmlcompressor", ">= 0.4", "< 1.0"
|
|
31
30
|
|
|
32
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
|
-
|
|
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,15 +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
|
-
|
|
50
|
+
def compressible?(resource)
|
|
51
|
+
return unless resource.destination.respond_to?(:output_ext)
|
|
52
|
+
|
|
53
|
+
[".html", ".svg", ".xml"].include?(resource.destination.output_ext)
|
|
52
54
|
end
|
|
53
55
|
|
|
54
56
|
def compressor
|
metadata
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bridgetown-minify-html
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mike Rogers
|
|
8
|
-
|
|
8
|
+
- Andrew Mason
|
|
9
|
+
autorequire:
|
|
9
10
|
bindir: bin
|
|
10
11
|
cert_chain: []
|
|
11
|
-
date:
|
|
12
|
+
date: 2022-05-25 00:00:00.000000000 Z
|
|
12
13
|
dependencies:
|
|
13
14
|
- !ruby/object:Gem::Dependency
|
|
14
15
|
name: bridgetown
|
|
@@ -16,7 +17,7 @@ dependencies:
|
|
|
16
17
|
requirements:
|
|
17
18
|
- - ">="
|
|
18
19
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
20
|
+
version: 1.0.0
|
|
20
21
|
- - "<"
|
|
21
22
|
- !ruby/object:Gem::Version
|
|
22
23
|
version: '2.0'
|
|
@@ -26,7 +27,7 @@ dependencies:
|
|
|
26
27
|
requirements:
|
|
27
28
|
- - ">="
|
|
28
29
|
- !ruby/object:Gem::Version
|
|
29
|
-
version:
|
|
30
|
+
version: 1.0.0
|
|
30
31
|
- - "<"
|
|
31
32
|
- !ruby/object:Gem::Version
|
|
32
33
|
version: '2.0'
|
|
@@ -120,18 +121,15 @@ dependencies:
|
|
|
120
121
|
- - "~>"
|
|
121
122
|
- !ruby/object:Gem::Version
|
|
122
123
|
version: '0.2'
|
|
123
|
-
description:
|
|
124
|
-
email:
|
|
124
|
+
description:
|
|
125
|
+
email: support@andrewm.codes
|
|
125
126
|
executables: []
|
|
126
127
|
extensions: []
|
|
127
128
|
extra_rdoc_files: []
|
|
128
129
|
files:
|
|
129
|
-
- ".github/
|
|
130
|
-
- ".github/workflows/changelog.yml"
|
|
131
|
-
- ".github/workflows/gempush.yml"
|
|
130
|
+
- ".github/workflows/release.yml"
|
|
132
131
|
- ".github/workflows/rspec.yml"
|
|
133
132
|
- ".github/workflows/rubocop.yml"
|
|
134
|
-
- ".github/workflows/spelling.yml"
|
|
135
133
|
- ".gitignore"
|
|
136
134
|
- ".rspec"
|
|
137
135
|
- ".rubocop.yml"
|
|
@@ -146,17 +144,16 @@ files:
|
|
|
146
144
|
- lib/bridgetown-minify-html/builder.rb
|
|
147
145
|
- lib/bridgetown-minify-html/minifier.rb
|
|
148
146
|
- lib/bridgetown-minify-html/version.rb
|
|
149
|
-
homepage: https://github.com/
|
|
147
|
+
homepage: https://github.com/bt-rb/bridgetown-minify-html
|
|
150
148
|
licenses:
|
|
151
149
|
- MIT
|
|
152
150
|
metadata:
|
|
153
|
-
bug_tracker_uri: https://github.com/
|
|
154
|
-
changelog_uri: https://github.com/
|
|
155
|
-
documentation_uri: https://github.com/
|
|
156
|
-
homepage_uri: https://github.com/
|
|
157
|
-
source_code_uri: https://github.com/
|
|
158
|
-
|
|
159
|
-
post_install_message:
|
|
151
|
+
bug_tracker_uri: https://github.com/bt-rb/bridgetown-minify-html/issues
|
|
152
|
+
changelog_uri: https://github.com/bt-rb/bridgetown-minify-html/blob/main/CHANGELOG.md
|
|
153
|
+
documentation_uri: https://github.com/bt-rb/bridgetown-minify-html
|
|
154
|
+
homepage_uri: https://github.com/bt-rb/bridgetown-minify-html
|
|
155
|
+
source_code_uri: https://github.com/bt-rb/bridgetown-minify-html
|
|
156
|
+
post_install_message:
|
|
160
157
|
rdoc_options: []
|
|
161
158
|
require_paths:
|
|
162
159
|
- lib
|
|
@@ -164,15 +161,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
164
161
|
requirements:
|
|
165
162
|
- - ">="
|
|
166
163
|
- !ruby/object:Gem::Version
|
|
167
|
-
version: '2.
|
|
164
|
+
version: '2.7'
|
|
168
165
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
166
|
requirements:
|
|
170
167
|
- - ">="
|
|
171
168
|
- !ruby/object:Gem::Version
|
|
172
169
|
version: '0'
|
|
173
170
|
requirements: []
|
|
174
|
-
rubygems_version: 3.
|
|
175
|
-
signing_key:
|
|
171
|
+
rubygems_version: 3.2.3
|
|
172
|
+
signing_key:
|
|
176
173
|
specification_version: 4
|
|
177
174
|
summary: Minify Outputted HTML in Bridgetown
|
|
178
175
|
test_files: []
|
data/.github/dependabot.yml
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
version: 2
|
|
2
|
-
|
|
3
|
-
updates:
|
|
4
|
-
|
|
5
|
-
# Maintain dependencies for GitHub Actions
|
|
6
|
-
- package-ecosystem: "github-actions"
|
|
7
|
-
directory: "/"
|
|
8
|
-
schedule:
|
|
9
|
-
interval: "daily"
|
|
10
|
-
|
|
11
|
-
# Maintain dependencies for Bundler
|
|
12
|
-
- package-ecosystem: "bundler"
|
|
13
|
-
directory: "/"
|
|
14
|
-
schedule:
|
|
15
|
-
interval: "daily"
|
|
16
|
-
|
|
17
|
-
# Maintain dependencies for Docker
|
|
18
|
-
- package-ecosystem: "docker"
|
|
19
|
-
directory: "/"
|
|
20
|
-
schedule:
|
|
21
|
-
interval: "daily"
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# From: https://github.com/hopsoft/stimulus_reflex/blob/master/.github/workflows/changelog.yml
|
|
2
|
-
name: Changelog
|
|
3
|
-
|
|
4
|
-
on:
|
|
5
|
-
release:
|
|
6
|
-
types: [created]
|
|
7
|
-
push:
|
|
8
|
-
branches:
|
|
9
|
-
- master
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
build:
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
timeout-minutes: 4
|
|
15
|
-
if: "!contains(github.event.head_commit.message, '[nodoc]')"
|
|
16
|
-
steps:
|
|
17
|
-
- uses: actions/checkout@master
|
|
18
|
-
- name: Set up Ruby 2.7
|
|
19
|
-
uses: ruby/setup-ruby@v1
|
|
20
|
-
with:
|
|
21
|
-
ruby-version: 2.7.1
|
|
22
|
-
- uses: actions/cache@v2
|
|
23
|
-
with:
|
|
24
|
-
path: vendor/bundle
|
|
25
|
-
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
|
|
26
|
-
restore-keys: |
|
|
27
|
-
${{ runner.os }}-gem-
|
|
28
|
-
- name: Create local changes
|
|
29
|
-
run: |
|
|
30
|
-
gem install github_changelog_generator
|
|
31
|
-
github_changelog_generator -u MikeRogers0 -p bridgetown-minify-html --token ${{ secrets.GITHUB_TOKEN }} --exclude-labels duplicate,question,invalid,wontfix,nodoc
|
|
32
|
-
- name: Commit files
|
|
33
|
-
run: |
|
|
34
|
-
git config --local user.email "github-actions@example.com"
|
|
35
|
-
git config --local user.name "GitHub Actions"
|
|
36
|
-
git commit -am "[nodoc] Update Changelog" || echo "No changes to commit"
|
|
37
|
-
- name: Push changes
|
|
38
|
-
uses: ad-m/github-push-action@master
|
|
39
|
-
with:
|
|
40
|
-
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
name: Build & Publish Ruby Gem
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
release:
|
|
5
|
-
types: [created]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
build:
|
|
9
|
-
name: Build + Publish
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
|
|
12
|
-
steps:
|
|
13
|
-
- uses: actions/checkout@v2
|
|
14
|
-
- name: Publish to GitHub Packages
|
|
15
|
-
uses: jstastny/publish-gem-to-github@master
|
|
16
|
-
with:
|
|
17
|
-
token: ${{ secrets.GITHUB_TOKEN }}
|
|
18
|
-
owner: MikeRogers0
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
name: Typo CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- master
|
|
7
|
-
pull_request:
|
|
8
|
-
jobs:
|
|
9
|
-
spellcheck:
|
|
10
|
-
name: Typo CI (GitHub Action)
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
timeout-minutes: 4
|
|
13
|
-
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
|
14
|
-
steps:
|
|
15
|
-
- name: TypoCheck
|
|
16
|
-
uses: typoci/spellcheck-action@master
|
|
17
|
-
# with:
|
|
18
|
-
# A license can be purchased via:
|
|
19
|
-
# https://gumroad.com/l/MvvBE
|
|
20
|
-
# typo_ci_license_key: ${{ secrets.TYPO_CI_LICENSE_KEY }}
|
|
21
|
-
env:
|
|
22
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|