jekyll-compress-flow 0.2.0 → 0.2.1
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 +15 -0
- data/README.md +8 -2
- data/interface.yml +20 -0
- data/lib/jekyll/compress_flow/interface.rb +22 -0
- data/lib/jekyll/compress_flow/version.rb +1 -1
- data/lib/jekyll/compress_flow.rb +20 -2
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6e5a152c5ea63749b35bd7f707fadc383a54312e61bde7b9bd89b68f8d9d072e
|
|
4
|
+
data.tar.gz: d3261bba8a601a796cbc016e6b7399983d8098eb4839ff8407e5ce8782c5bbfd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f8acbb85dd3422bb2ce6247ff85de0458b05b883069e45c6154e3d1f38b2dfa4519de216899754697cdeed086beeb0079516d1e226961175f803140ba4bcd5bd
|
|
7
|
+
data.tar.gz: a28861fff7a8b4bacf3ae6359934b6fbe24682679d24b1828e5d7aac4b9ad631925831ca7c64268b1b10d892d01de49689cefdabcc2d67820175b3257799aa2c
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## 0.2.1 — 2026-10-06
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `Jekyll::CompressFlow::Interface.to_h` — the config surface
|
|
12
|
+
(`compress_flow` keys plus `formats:`/`priority:` enums) derived from
|
|
13
|
+
`DEFAULTS`, serialized to a committed `interface.yml` by
|
|
14
|
+
`rake interface`; `interface_spec.rb` pins manifest freshness.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Register the compression dispatcher at low priority (10) by default, after
|
|
19
|
+
normal-priority processing and Fingerprint Flow (default 12); allow per-site
|
|
20
|
+
`compress_flow.priority` values from 0 through 10.
|
|
21
|
+
|
|
7
22
|
## 0.2.0 — 2026-10-03
|
|
8
23
|
|
|
9
24
|
### Added
|
data/README.md
CHANGED
|
@@ -124,16 +124,22 @@ configured to negotiate them via `Accept-Encoding`:
|
|
|
124
124
|
```yaml
|
|
125
125
|
compress_flow:
|
|
126
126
|
enabled: true # default: Jekyll.env == "production"
|
|
127
|
+
priority: 10 # integer 0..10; default 10, after fingerprinting
|
|
127
128
|
formats: [br, zst, gz] # subset of the three; unknown names abort
|
|
128
129
|
extensions: [html, css, js, json, xml, svg, txt, map]
|
|
129
130
|
min_size: 0 # bytes — skip tiny files
|
|
130
131
|
fail_on_error: true # false: warn + skip instead of failing build
|
|
131
132
|
```
|
|
132
133
|
|
|
134
|
+
The post-write dispatcher accepts integer priorities from 0 through 10 so
|
|
135
|
+
site-specific compression remains after the default Fingerprint Flow range
|
|
136
|
+
(11–19).
|
|
137
|
+
|
|
133
138
|
## Behavior
|
|
134
139
|
|
|
135
|
-
- Runs on `:site, :post_write
|
|
136
|
-
|
|
140
|
+
- Runs on `:site, :post_write` at low priority (10), after normal-priority
|
|
141
|
+
post-processors and the priority-12 Fingerprint Flow pass — works with any
|
|
142
|
+
generator (pages, posts, feeds, sitemap, search JSON).
|
|
137
143
|
- Compressed siblings are never re-compressed (extensions not in the
|
|
138
144
|
list); images/fonts/PDFs are skipped (already compressed formats).
|
|
139
145
|
- A missing CLI tool aborts the build once per format
|
data/interface.yml
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Generated by `rake interface` — do not edit.
|
|
2
|
+
# Public tag/config surface for tooling (editor extensions, doc linters).
|
|
3
|
+
---
|
|
4
|
+
gem: jekyll-compress-flow
|
|
5
|
+
version: 0.2.1
|
|
6
|
+
tags: {}
|
|
7
|
+
filters: []
|
|
8
|
+
config:
|
|
9
|
+
compress_flow:
|
|
10
|
+
- enabled
|
|
11
|
+
- extensions
|
|
12
|
+
- fail_on_error
|
|
13
|
+
- formats
|
|
14
|
+
- min_size
|
|
15
|
+
- priority
|
|
16
|
+
enums:
|
|
17
|
+
formats:
|
|
18
|
+
- br
|
|
19
|
+
- gz
|
|
20
|
+
- zst
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Jekyll
|
|
4
|
+
module CompressFlow
|
|
5
|
+
# Machine-readable description of the plugin's public interface:
|
|
6
|
+
# config keys and enum values (this plugin registers no Liquid tags).
|
|
7
|
+
# `rake interface` writes this as interface.yml (shipped in the gem) so
|
|
8
|
+
# tooling like editor extensions can consume it without parsing Ruby.
|
|
9
|
+
module Interface
|
|
10
|
+
def self.to_h
|
|
11
|
+
{
|
|
12
|
+
"gem" => "jekyll-compress-flow",
|
|
13
|
+
"version" => VERSION,
|
|
14
|
+
"tags" => {},
|
|
15
|
+
"filters" => [],
|
|
16
|
+
"config" => { "compress_flow" => DEFAULTS.keys.sort },
|
|
17
|
+
"enums" => { "formats" => FORMATS.keys.sort }
|
|
18
|
+
}
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
data/lib/jekyll/compress_flow.rb
CHANGED
|
@@ -4,6 +4,7 @@ require "jekyll"
|
|
|
4
4
|
require "open3"
|
|
5
5
|
|
|
6
6
|
require_relative "compress_flow/version"
|
|
7
|
+
require_relative "compress_flow/interface"
|
|
7
8
|
|
|
8
9
|
module Jekyll
|
|
9
10
|
# Generates .br/.zst/.gz siblings for text assets in the build output so a
|
|
@@ -23,8 +24,11 @@ module Jekyll
|
|
|
23
24
|
"gz" => { "tool" => "gzip", "args" => %w[-f -9 -k] }
|
|
24
25
|
}.freeze
|
|
25
26
|
|
|
27
|
+
DEFAULT_POST_WRITE_PRIORITY = 10
|
|
28
|
+
POST_WRITE_PRIORITIES = (0..DEFAULT_POST_WRITE_PRIORITY)
|
|
26
29
|
DEFAULTS = {
|
|
27
30
|
"enabled" => nil, # nil => Jekyll.env == "production"
|
|
31
|
+
"priority" => DEFAULT_POST_WRITE_PRIORITY,
|
|
28
32
|
"extensions" => %w[html css js json xml svg txt map],
|
|
29
33
|
"formats" => %w[br zst gz],
|
|
30
34
|
"min_size" => 0,
|
|
@@ -33,6 +37,14 @@ module Jekyll
|
|
|
33
37
|
|
|
34
38
|
module_function
|
|
35
39
|
|
|
40
|
+
def post_write_priority(config)
|
|
41
|
+
priority = config.transform_keys(&:to_s).fetch("priority", DEFAULT_POST_WRITE_PRIORITY)
|
|
42
|
+
return priority if priority.is_a?(Integer) && POST_WRITE_PRIORITIES.cover?(priority)
|
|
43
|
+
|
|
44
|
+
raise Jekyll::Errors::FatalException,
|
|
45
|
+
"CompressFlow: compress_flow.priority must be an integer from 0 through 10"
|
|
46
|
+
end
|
|
47
|
+
|
|
36
48
|
# Entry point — compress all matching files under +dest+.
|
|
37
49
|
# +config+ is the site's `compress_flow:` mapping (string or symbol keys).
|
|
38
50
|
def run(dest, config = {})
|
|
@@ -114,6 +126,12 @@ module Jekyll
|
|
|
114
126
|
end
|
|
115
127
|
end
|
|
116
128
|
|
|
117
|
-
Jekyll::
|
|
118
|
-
|
|
129
|
+
Jekyll::CompressFlow::POST_WRITE_PRIORITIES.each do |hook_priority|
|
|
130
|
+
registered_priority = hook_priority
|
|
131
|
+
Jekyll::Hooks.register :site, :post_write, priority: registered_priority do |site|
|
|
132
|
+
config = site.config["compress_flow"] || {}
|
|
133
|
+
next unless Jekyll::CompressFlow.post_write_priority(config) == registered_priority
|
|
134
|
+
|
|
135
|
+
Jekyll::CompressFlow.run(site.dest, config)
|
|
136
|
+
end
|
|
119
137
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll-compress-flow
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Svend Gundestrup
|
|
@@ -42,8 +42,10 @@ files:
|
|
|
42
42
|
- CHANGELOG.md
|
|
43
43
|
- LICENSE
|
|
44
44
|
- README.md
|
|
45
|
+
- interface.yml
|
|
45
46
|
- lib/jekyll-compress-flow.rb
|
|
46
47
|
- lib/jekyll/compress_flow.rb
|
|
48
|
+
- lib/jekyll/compress_flow/interface.rb
|
|
47
49
|
- lib/jekyll/compress_flow/version.rb
|
|
48
50
|
homepage: https://github.com/gundestrup/jekyll-compress-flow
|
|
49
51
|
licenses:
|