jekyll-brotli 2.2.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73109bbbd64c95c1e4faf0942548d26408cf49eae0daf2208889bc347bd09875
4
- data.tar.gz: db719fab85a82b51265f2184f5698265b041e321783148446c86109fe8e287a9
3
+ metadata.gz: 33b59dc1c8f31a07b8775952290fb96e5685595adf2cd66fd49ace40ef8651f6
4
+ data.tar.gz: 3de63515bffa570a09dc045c9395309f6b38dab6021694aafbdc007599a883a2
5
5
  SHA512:
6
- metadata.gz: b5ad5ec86cd1b3fae3611f932ca3c66a536d54c061e231a12b4ad72b14b5a6b7db1b307307590f99da07ebffe90f7df797be0daa79ac9467588681d94490c51b
7
- data.tar.gz: 5b768f537e61b0e8729e8fe801f55e3ca1d0106a159add09cac7495c19d1e0c3f7eaed99b1b7a6d9578cceb41aed68e55e5bb878e46c187781515771eb69e95a
6
+ metadata.gz: 61fcaa61cc32ed1fa008ea36752ddb3a0d86be1353e60c79c4812fad81d06d33bda20f57aa4052d37cfcd901ec866af36367ed38fec1af06a284e6bd1e2a87ea
7
+ data.tar.gz: 4c2b873ed1072ab6d2aa693fc1ec7ef77860acc68ca2a985e17407b0e2b72c82b71494b6e0f1702c4d62930b6278e6be29a5196e6522c8c14b8cf3123829b638
@@ -0,0 +1 @@
1
+ github: philnash
@@ -0,0 +1,25 @@
1
+ name: tests
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ fail-fast: false
10
+ matrix:
11
+ ruby: [2.5, 2.6, 2.7, 3.0, head]
12
+ jekyll: ["3.0", "4.0"]
13
+ continue-on-error: ${{ endsWith(matrix.ruby, 'head') }}
14
+ env:
15
+ JEKYLL_VERSION: ~> ${{ matrix.jekyll }}
16
+ steps:
17
+ - uses: actions/checkout@v2
18
+ - name: Set up Ruby ${{ matrix.ruby }}
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.ruby }}
22
+ - name: "Install dependencies"
23
+ run: bundle install
24
+ - name: Run tests
25
+ run: bundle exec rspec
data/CHANGELOG.md CHANGED
@@ -1,6 +1,19 @@
1
1
  # Changelog
2
2
 
3
- ## Ongoing [☰](https://github.com/philnash/jekyll-brotli/compare/v2.2.1...master)
3
+ ## Ongoing [☰](https://github.com/philnash/jekyll-brotli/compare/v2.3.0...main)
4
+
5
+ ...
6
+
7
+ ## 2.3.0 (2021-02-13) [☰](https://github.com/philnash/jekyll-brotli/compare/v2.2.1...v2.3.0)
8
+
9
+ ### Fixed
10
+
11
+ - Stop overwriting Jekyll config, which invalidates the Jekyll cache (see https://github.com/jekyll/jekyll/issues/8551)
12
+
13
+ ### Changed
14
+
15
+ - Added JSON files to compressable extensions
16
+ - Moved from Travis CI to GitHub Actions
4
17
 
5
18
  ## 2.2.1 (2020-01-30) [☰](https://github.com/philnash/jekyll-brotli/compare/v2.2.0...v2.2.1)
6
19
 
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Generate compressed assets and files for your Jekyll site at build time using [Brotli](https://github.com/google/brotli) compression.
4
4
 
5
- [![Gem Version](https://badge.fury.io/rb/jekyll-brotli.svg)](https://rubygems.org/gems/jekyll-brotli) [![Build Status](https://travis-ci.org/philnash/jekyll-brotli.svg?branch=master)](https://travis-ci.org/philnash/jekyll-brotli) [![Maintainability](https://api.codeclimate.com/v1/badges/9deb43d992a0c47a55e4/maintainability)](https://codeclimate.com/github/philnash/jekyll-brotli/maintainability) [![Inline docs](https://inch-ci.org/github/philnash/jekyll-brotli.svg?branch=master)](https://inch-ci.org/github/philnash/jekyll-brotli)
5
+ [![Gem Version](https://badge.fury.io/rb/jekyll-brotli.svg)](https://rubygems.org/gems/jekyll-brotli) [![Build status](https://github.com/philnash/jekyll-brotli/workflows/tests/badge.svg)](https://github.com/philnash/jekyll-brotli/actions) [![Maintainability](https://api.codeclimate.com/v1/badges/9deb43d992a0c47a55e4/maintainability)](https://codeclimate.com/github/philnash/jekyll-brotli/maintainability) [![Inline docs](https://inch-ci.org/github/philnash/jekyll-brotli.svg?branch=main)](https://inch-ci.org/github/philnash/jekyll-brotli)
6
6
 
7
7
  [API docs](http://www.rubydoc.info/gems/jekyll-brotli/) | [GitHub repo](https://github.com/philnash/jekyll-brotli)
8
8
 
@@ -38,6 +38,34 @@ Once you have the gem installed, run `JEKYLL_ENV=production bundle exec jekyll b
38
38
 
39
39
  Jekyll::Brotli only runs when the environment variable `JEKYLL_ENV` is set to `production` as dealing with compressing files is unnecessary in development mode and just slows down the site build.
40
40
 
41
+ ### Configuration
42
+
43
+ #### Extensions
44
+
45
+ By default, `Jekyll::Brotli` will compress all files with the following extensions:
46
+
47
+ - '.html'
48
+ - '.css'
49
+ - '.js'
50
+ - '.json'
51
+ - '.txt'
52
+ - '.ttf'
53
+ - '.atom'
54
+ - '.stl'
55
+ - '.xml'
56
+ - '.svg'
57
+ - '.eot'
58
+
59
+ You can supply your own extensions by adding a `brotli` key to your site's `_config.yml` listing the extensions that you want to compress. For example to only compress HTML, CSS and JavaScript files, add the following to `_config.yml`:
60
+
61
+ ```yml
62
+ brotli:
63
+ extensions:
64
+ - '.html'
65
+ - '.css'
66
+ - '.js
67
+ ```
68
+
41
69
  ### Serving pre-compiled gzip files
42
70
 
43
71
  You will likely need to adjust your web server config to serve these precomputed gzip files. See below for common server configurations:
@@ -68,4 +96,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
68
96
 
69
97
  ## Code of Conduct
70
98
 
71
- Everyone interacting in the Jekyll::Brotli project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/philnash/jekyll-gzip/blob/master/CODE_OF_CONDUCT.md).
99
+ Everyone interacting in the Jekyll::Brotli project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/philnash/jekyll-gzip/blob/main/CODE_OF_CONDUCT.md).
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.add_dependency "brotli", "~> 0.2.0"
26
26
 
27
27
  spec.add_development_dependency "bundler", ">= 1.16", "< 3.0"
28
- spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_development_dependency "rake", "~> 13.0"
29
29
  spec.add_development_dependency "rspec", "~> 3.0"
30
30
  spec.add_development_dependency "simplecov", "~> 0.15.1"
31
31
  end
data/lib/jekyll/brotli.rb CHANGED
@@ -10,11 +10,6 @@ module Jekyll
10
10
  end
11
11
  end
12
12
 
13
- Jekyll::Hooks.register :site, :after_init do |site|
14
- config = site.config['brotli'] || {}
15
- site.config['brotli'] = Jekyll::Brotli::DEFAULT_CONFIG.merge(config) || {}
16
- end
17
-
18
13
  Jekyll::Hooks.register :site, :post_write do |site|
19
14
  Jekyll::Brotli::Compressor.compress_site(site) if Jekyll.env == 'production'
20
15
  end
@@ -91,7 +91,7 @@ module Jekyll
91
91
  end
92
92
 
93
93
  def self.compressable_extensions(site)
94
- site.config['brotli'] && site.config['brotli']['extensions'] || Jekyll::Brotli::DEFAULT_CONFIG['extensions']
94
+ site.config.dig("brotli", "extensions") || Jekyll::Brotli::DEFAULT_CONFIG.fetch("extensions")
95
95
  end
96
96
 
97
97
  # Compresses the file if the site is built incrementally and the
@@ -7,6 +7,7 @@ module Jekyll
7
7
  '.html',
8
8
  '.css',
9
9
  '.js',
10
+ '.json',
10
11
  '.txt',
11
12
  '.ttf',
12
13
  '.atom',
@@ -17,4 +18,4 @@ module Jekyll
17
18
  ].freeze
18
19
  }.freeze
19
20
  end
20
- end
21
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Brotli
5
- VERSION = "2.2.1"
5
+ VERSION = "2.3.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-brotli
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phil Nash
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-30 00:00:00.000000000 Z
11
+ date: 2021-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -70,14 +70,14 @@ dependencies:
70
70
  requirements:
71
71
  - - "~>"
72
72
  - !ruby/object:Gem::Version
73
- version: '10.0'
73
+ version: '13.0'
74
74
  type: :development
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - "~>"
79
79
  - !ruby/object:Gem::Version
80
- version: '10.0'
80
+ version: '13.0'
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: rspec
83
83
  requirement: !ruby/object:Gem::Requirement
@@ -114,9 +114,10 @@ executables: []
114
114
  extensions: []
115
115
  extra_rdoc_files: []
116
116
  files:
117
+ - ".github/FUNDING.yml"
118
+ - ".github/workflows/tests.yml"
117
119
  - ".gitignore"
118
120
  - ".rspec"
119
- - ".travis.yml"
120
121
  - CHANGELOG.md
121
122
  - CODE_OF_CONDUCT.md
122
123
  - Gemfile
@@ -135,7 +136,7 @@ homepage: https://github.com/philnash/jekyll-brotli
135
136
  licenses:
136
137
  - MIT
137
138
  metadata: {}
138
- post_install_message:
139
+ post_install_message:
139
140
  rdoc_options: []
140
141
  require_paths:
141
142
  - lib
@@ -150,8 +151,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
151
  - !ruby/object:Gem::Version
151
152
  version: '0'
152
153
  requirements: []
153
- rubygems_version: 3.0.3
154
- signing_key:
154
+ rubygems_version: 3.1.4
155
+ signing_key:
155
156
  specification_version: 4
156
157
  summary: Generate brotli compressed assets and files for your Jekyll site at build
157
158
  time.
data/.travis.yml DELETED
@@ -1,15 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.7
5
- - 2.6
6
- - 2.5
7
- - 2.4
8
- - ruby-head
9
- env:
10
- - 'JEKYLL_VERSION="~> 3.0"'
11
- - 'JEKYLL_VERSION="~> 4.0"'
12
- matrix:
13
- allow_failures:
14
- - rvm: ruby-head
15
- script: bundle exec rspec