jekyll_picture_tag 2.1.2 → 2.1.3
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/code-checks.yml +3 -3
- data/docs/Gemfile +0 -1
- data/docs/Gemfile.lock +0 -3
- data/docs/_config.yml +2 -2
- data/docs/devs/contributing/testing.md +0 -2
- data/docs/devs/releases.md +6 -4
- data/docs/users/presets/image_formats.md +1 -1
- data/docs/users/presets/subpresets.md +97 -0
- data/jekyll_picture_tag.gemspec +0 -1
- data/lib/jekyll_picture_tag/parsers/image_backend.rb +14 -3
- data/lib/jekyll_picture_tag/version.rb +1 -1
- data/package-lock.json +6 -0
- data/readme.md +3 -1
- metadata +5 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ccbffcf313082eec49e27ba5e80d9b6f5d6727dda3125562c5822209eea8cec
|
4
|
+
data.tar.gz: b1c68f683fd243b960a9d15a7556927175fcdd9a94f2e3438b32d543beb56ebf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d821c75305bb4d3022fab0f5bbba9503f05280d01c16414c91eb00d78746367612236c11d09eb7b34b2a10ec2d16349d91676756e313c85c60e7602c26b69078
|
7
|
+
data.tar.gz: cdd31c120638ebeaed12cb9d37bf7196997d8f6b05f33c2eaba3940e01915921e3d665d2f5cc041f5ed80b0ecdcae1d65bc99140887e7832a43d66b1a748c935
|
@@ -8,15 +8,15 @@ on:
|
|
8
8
|
|
9
9
|
jobs:
|
10
10
|
checks:
|
11
|
-
runs-on: ubuntu-
|
11
|
+
runs-on: ubuntu-22.04
|
12
12
|
|
13
13
|
steps:
|
14
14
|
|
15
15
|
- name: Install system dependencies
|
16
|
-
run: sudo apt install libjpeg-dev webp libpng-dev
|
16
|
+
run: sudo apt-get update && sudo apt-get install --yes libjpeg-dev webp libpng-dev libavif-dev libheif-dev libopenjpip7 imagemagick libvips-tools build-essential
|
17
17
|
|
18
18
|
- name: Checkout repo
|
19
|
-
uses: actions/checkout@
|
19
|
+
uses: actions/checkout@v4
|
20
20
|
|
21
21
|
# Version taken from .ruby-version file.
|
22
22
|
# Also runs bundle install.
|
data/docs/Gemfile
CHANGED
data/docs/Gemfile.lock
CHANGED
@@ -136,8 +136,6 @@ GEM
|
|
136
136
|
addressable (~> 2.0)
|
137
137
|
jekyll (>= 3.5, < 5.0)
|
138
138
|
rubyzip (>= 1.3.0)
|
139
|
-
jekyll-rtd-theme (0.1.6)
|
140
|
-
github-pages (~> 206)
|
141
139
|
jekyll-sass-converter (1.5.2)
|
142
140
|
sass (~> 3.4)
|
143
141
|
jekyll-seo-tag (2.6.1)
|
@@ -245,7 +243,6 @@ PLATFORMS
|
|
245
243
|
|
246
244
|
DEPENDENCIES
|
247
245
|
github-pages
|
248
|
-
jekyll-rtd-theme
|
249
246
|
|
250
247
|
BUNDLED WITH
|
251
248
|
2.1.4
|
data/docs/_config.yml
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
remote_theme:
|
1
|
+
remote_theme: rbuchberger/jekyll-rtd-theme@main
|
2
2
|
|
3
3
|
title: Jekyll Picture Tag
|
4
4
|
description: Images for Jekyll, done correctly.
|
5
5
|
lang: en-US
|
6
6
|
|
7
7
|
baseurl: '/jekyll_picture_tag'
|
8
|
-
readme_index:
|
8
|
+
readme_index:
|
9
9
|
with_frontmatter: true
|
@@ -19,5 +19,3 @@ The primary way to run these checks is `rake`:
|
|
19
19
|
* Depending on your environment, you may need to prefix all rake commands with `bundle exec`
|
20
20
|
* Simplecov is set up -- you'll get a measurement of coverage in the test output and a nice report
|
21
21
|
in the `coverage` directory.
|
22
|
-
* The tests use the `/tmp/` directory directly, which I'm pretty sure means it won't work on
|
23
|
-
Windows. This is fixable, so if that gets in your way just ask.
|
data/docs/devs/releases.md
CHANGED
@@ -2,13 +2,15 @@
|
|
2
2
|
---
|
3
3
|
# Release History
|
4
4
|
|
5
|
+
* 2.1.3 10 June, 2025
|
6
|
+
* Decide whether to call `magick` or `convert` more intelligently. This adds Windows support, without breaking JPT on Ubuntu or other distros that only ship an ancient version of ImageMagick. Thanks to [@MUmarShahbaz](https://github.com/MUmarShahbaz) for [#324](https://github.com/rbuchberger/jekyll_picture_tag/pull/324)
|
5
7
|
* 2.1.2 13 September, 2024
|
6
8
|
* Remove overly specific version spec for ruby-vips - thanks to [@hschne](https://github.com/hschne) for [#313](https://github.com/rbuchberger/jekyll_picture_tag/pull/313)
|
7
9
|
* 2.1.1 20 July, 2024
|
8
10
|
* Don't provide Q setting for PPM images - thanks to @dichiban for [#309](https://github.com/rbuchberger/jekyll_picture_tag/pull/309)
|
9
11
|
* Fix alpha premultiplication - thanks to @KaarlisCaune for [#302](https://github.com/rbuchberger/jekyll_picture_tag/pull/302)
|
10
12
|
* 2.1.0 29 January, 2024
|
11
|
-
* Check whether the vips CLI is installed before trying to use it. Thanks to @philrb for
|
13
|
+
* Check whether the vips CLI is installed before trying to use it. Thanks to @philrb for
|
12
14
|
[#299](https://github.com/rbuchberger/jekyll_picture_tag/pull/299)
|
13
15
|
* Update minimum required mocha version to maintain compatibility with minitest
|
14
16
|
* 2.0.4 August 16, 2022
|
@@ -33,11 +35,11 @@
|
|
33
35
|
* Require Ruby >= 2.6, support Ruby 3.0
|
34
36
|
* Require Jekyll >= 4.0
|
35
37
|
* Cropping is changing.
|
36
|
-
|
38
|
+
* We now use the libvips
|
37
39
|
[smartcrop function](https://www.rubydoc.info/gems/ruby-vips/Vips/Image#smartcrop-instance_method),
|
38
40
|
which does some magic to keep the most useful part of the image.
|
39
|
-
|
40
|
-
|
41
|
+
* Geometry is renamed to 'crop', and reduced to simple aspect ratios only. (`width:height`)
|
42
|
+
* Gravity is gone, replaced by 'keep' which is translated to a libvips
|
41
43
|
[interestingness](https://www.rubydoc.info/gems/ruby-vips/Vips/Interesting) setting.
|
42
44
|
* Add stock presets and media queries, under the `jpt-` prefix.
|
43
45
|
* Add `format_quality` default settings for webp, avif, and jp2.
|
@@ -17,5 +17,5 @@ used**. `original` does what you'd expect. To supply webp, you must have an
|
|
17
17
|
imagemagick webp delegate installed. (Most package managers just name it 'webp')
|
18
18
|
|
19
19
|
_Supported formats are anything which imagemagick supports, and has an installed
|
20
|
-
delegate. See a list by running `$
|
20
|
+
delegate. See a list by running `$ magick --version`_.
|
21
21
|
|
@@ -0,0 +1,97 @@
|
|
1
|
+
---
|
2
|
+
sort: 15
|
3
|
+
---
|
4
|
+
|
5
|
+
# Aliases & Subpresets
|
6
|
+
|
7
|
+
If you're making more than one preset, you probably have things you'd prefer to not copy to every preset. Maybe some finely tuned quality settings, or different variations and crops. Thankfully, YAML has an anchor & alias feature to help with this.
|
8
|
+
|
9
|
+
Anchors are defined with a `&` and a name, placed after a key, but before the value. For the sake of example, we've defined a quality for JPEG, and given it the anchor "high_quality".
|
10
|
+
|
11
|
+
```yml
|
12
|
+
default:
|
13
|
+
format_quality:
|
14
|
+
jpg: &high_quality 90
|
15
|
+
```
|
16
|
+
|
17
|
+
With our anchor added, we can refer back to it with an alias. These are in the same format, but we use a `*` instead. (and we don't place a value, since we're making the alias our value!)
|
18
|
+
|
19
|
+
```yml
|
20
|
+
logo:
|
21
|
+
format_quality:
|
22
|
+
jpg: *high_quality
|
23
|
+
```
|
24
|
+
|
25
|
+
Now any time we change our default quality, the quality in the logo preset will be updated too!
|
26
|
+
|
27
|
+
|
28
|
+
## Subpresets
|
29
|
+
|
30
|
+
Where this feature really gets powerful, is the ability to base a preset entirely off another.
|
31
|
+
|
32
|
+
In the block below, we've created a base preset, which we'll build every other one upon. We can override any of the values later on, if we want to.
|
33
|
+
|
34
|
+
```yml
|
35
|
+
base: &base
|
36
|
+
formats: [webp, original]
|
37
|
+
format_quality:
|
38
|
+
webp: 90
|
39
|
+
attributes:
|
40
|
+
img: 'loading="lazy"'
|
41
|
+
```
|
42
|
+
|
43
|
+
Now we can use the special merge key, `<<`, which will copy all values from an aliased map into the new one.
|
44
|
+
|
45
|
+
```yml
|
46
|
+
default:
|
47
|
+
<<: *base
|
48
|
+
widths: [500, 600, 700, 800, 900, 1000, 1200, 1600]
|
49
|
+
link_source: true
|
50
|
+
|
51
|
+
project_showcase:
|
52
|
+
<<: *base
|
53
|
+
widths: [700, 864, 900, 1296, 1600, 1728]
|
54
|
+
```
|
55
|
+
|
56
|
+
Since both of these new presets merge our base preset, the final result will be parsed like this:
|
57
|
+
|
58
|
+
```yml
|
59
|
+
default:
|
60
|
+
formats: [webp, original]
|
61
|
+
format_quality:
|
62
|
+
webp: 90
|
63
|
+
attributes:
|
64
|
+
img: 'loading="lazy"'
|
65
|
+
widths: [500, 600, 700, 800, 900, 1000, 1200, 1600]
|
66
|
+
link_source: true
|
67
|
+
|
68
|
+
project_showcase:
|
69
|
+
formats: [webp, original]
|
70
|
+
format_quality:
|
71
|
+
webp: 90
|
72
|
+
attributes:
|
73
|
+
img: 'loading="lazy"'
|
74
|
+
widths: [700, 864, 900, 1296, 1600, 1728]
|
75
|
+
```
|
76
|
+
|
77
|
+
Note however, this is **not a deep merge**, only a shallow merge. What that means is, any values nested in the preset will be overwritten by the presence of a key. If we bring back our previous example, but add an attribute to it:
|
78
|
+
|
79
|
+
```yml
|
80
|
+
project_showcase:
|
81
|
+
<<: *base
|
82
|
+
widths: [700, 864, 900, 1296, 1600, 1728]
|
83
|
+
attributes:
|
84
|
+
picture: 'class="showcase"'
|
85
|
+
```
|
86
|
+
|
87
|
+
You'll notice that, although we didn't change the `img` attributes, the parsed result will be **missing the attributes from the parent preset**, like this:
|
88
|
+
|
89
|
+
```yml
|
90
|
+
project_showcase:
|
91
|
+
formats: [webp, original]
|
92
|
+
format_quality:
|
93
|
+
webp: 90
|
94
|
+
attributes:
|
95
|
+
picture: 'class="showcase"'
|
96
|
+
widths: [700, 864, 900, 1296, 1600, 1728]
|
97
|
+
```
|
data/jekyll_picture_tag.gemspec
CHANGED
@@ -57,5 +57,4 @@ Gem::Specification.new do |spec|
|
|
57
57
|
spec.add_development_dependency 'rubocop-performance', '~> 1.9.0'
|
58
58
|
spec.add_development_dependency 'rubocop-rake', '~> 0.5.0'
|
59
59
|
spec.add_development_dependency 'simplecov', '~> 0.20.0'
|
60
|
-
spec.add_development_dependency 'solargraph'
|
61
60
|
end
|
@@ -28,7 +28,13 @@ module PictureTag
|
|
28
28
|
|
29
29
|
# Returns an array of formats that imagemagick can handle.
|
30
30
|
def magick_formats
|
31
|
-
if command?('
|
31
|
+
if command?('magick')
|
32
|
+
@magick_formats ||= `magick -version`
|
33
|
+
.scan(/Delegates.*/)
|
34
|
+
.first
|
35
|
+
.delete_prefix('Delegates (built-in):')
|
36
|
+
.split
|
37
|
+
elsif command?('convert')
|
32
38
|
@magick_formats ||= `convert -version`
|
33
39
|
.scan(/Delegates.*/)
|
34
40
|
.first
|
@@ -56,7 +62,7 @@ module PictureTag
|
|
56
62
|
else
|
57
63
|
'Libvips is not installed.'
|
58
64
|
end
|
59
|
-
str << if command?('convert')
|
65
|
+
str << if command?('magick') || command?('convert')
|
60
66
|
"Imagemagick (installed) supports: \"#{magick_formats.join(', ')}\"."
|
61
67
|
else
|
62
68
|
'Imagemagick is not installed.'
|
@@ -69,7 +75,12 @@ module PictureTag
|
|
69
75
|
end
|
70
76
|
|
71
77
|
def command?(command)
|
72
|
-
|
78
|
+
is_windows = RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
79
|
+
if is_windows
|
80
|
+
system("where #{command} > NUL 2>&1")
|
81
|
+
else
|
82
|
+
system("which #{command} > /dev/null 2>&1")
|
83
|
+
end
|
73
84
|
end
|
74
85
|
end
|
75
86
|
end
|
data/package-lock.json
ADDED
data/readme.md
CHANGED
@@ -44,8 +44,10 @@ Tag is your responsive images minion - give it simple instructions and it'll han
|
|
44
44
|
|
45
45
|
<https://rbuchberger.github.io/jekyll_picture_tag/devs/releases>
|
46
46
|
|
47
|
-
|
47
|
+
2.0 and later releases:
|
48
48
|
|
49
|
+
* 2.1.3 10 June, 2025
|
50
|
+
* Decide whether to call `magick` or `convert` more intelligently. This adds Windows support, without breaking JPT on Ubuntu or other distros that only ship an ancient version of ImageMagick. Thanks to [@MUmarShahbaz](https://github.com/MUmarShahbaz) for [#324](https://github.com/rbuchberger/jekyll_picture_tag/pull/324)
|
49
51
|
* 2.1.2 13 September, 2024
|
50
52
|
* Remove overly specific version spec for ruby-vips - thanks to [@hschne](https://github.com/hschne) for [#313](https://github.com/rbuchberger/jekyll_picture_tag/pull/313)
|
51
53
|
* 2.1.1 20 July, 2024
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll_picture_tag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Wierzbowski
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2025-06-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: addressable
|
@@ -264,20 +264,6 @@ dependencies:
|
|
264
264
|
- - "~>"
|
265
265
|
- !ruby/object:Gem::Version
|
266
266
|
version: 0.20.0
|
267
|
-
- !ruby/object:Gem::Dependency
|
268
|
-
name: solargraph
|
269
|
-
requirement: !ruby/object:Gem::Requirement
|
270
|
-
requirements:
|
271
|
-
- - ">="
|
272
|
-
- !ruby/object:Gem::Version
|
273
|
-
version: '0'
|
274
|
-
type: :development
|
275
|
-
prerelease: false
|
276
|
-
version_requirements: !ruby/object:Gem::Requirement
|
277
|
-
requirements:
|
278
|
-
- - ">="
|
279
|
-
- !ruby/object:Gem::Version
|
280
|
-
version: '0'
|
281
267
|
description: |2
|
282
268
|
Jekyll Picture Tag adds responsive images to your Jekyll static site. It
|
283
269
|
automatically creates resized source images, is fully configurable, and
|
@@ -356,6 +342,7 @@ files:
|
|
356
342
|
- docs/users/presets/nomarkdown_override.md
|
357
343
|
- docs/users/presets/pixel_ratio_srcsets.md
|
358
344
|
- docs/users/presets/quality_width_graph.png
|
345
|
+
- docs/users/presets/subpresets.md
|
359
346
|
- docs/users/presets/width_height_attributes.md
|
360
347
|
- docs/users/presets/width_srcsets.md
|
361
348
|
- docs/users/presets/writing_presets.md
|
@@ -404,6 +391,7 @@ files:
|
|
404
391
|
- lib/jekyll_picture_tag/srcsets/width.rb
|
405
392
|
- lib/jekyll_picture_tag/utils.rb
|
406
393
|
- lib/jekyll_picture_tag/version.rb
|
394
|
+
- package-lock.json
|
407
395
|
- readme.md
|
408
396
|
homepage: https://github.com/rbuchberger/jekyll_picture_tag
|
409
397
|
licenses:
|
@@ -429,7 +417,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
429
417
|
version: '0'
|
430
418
|
requirements:
|
431
419
|
- libvips
|
432
|
-
rubygems_version: 3.
|
420
|
+
rubygems_version: 3.4.19
|
433
421
|
signing_key:
|
434
422
|
specification_version: 4
|
435
423
|
summary: Easy responsive images for Jekyll.
|