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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c2eba1d97111de1ef819824525ee40dadc297235b0d9a723e50292aca614277
4
- data.tar.gz: 2b50ae28f44441be8b41329cc488d99afb68954f13b3292af1bac90e1cbc9fad
3
+ metadata.gz: 9ccbffcf313082eec49e27ba5e80d9b6f5d6727dda3125562c5822209eea8cec
4
+ data.tar.gz: b1c68f683fd243b960a9d15a7556927175fcdd9a94f2e3438b32d543beb56ebf
5
5
  SHA512:
6
- metadata.gz: 8b9be36209c87b8475377e7f76117f1d0ac042d885f10e46f49a757d18af751a5df4953b2bd85ebbe94af77fd878e8a425394e713c181573e71d2c00c53be8f0
7
- data.tar.gz: 1c7a556b2f1bc1b0a29010e9c7a8c484df86b049ac0247d831b23b7c58478f3b0a54a07df014b126af727d4f110677f0c366a83712b9f10b8229b3b9dbb7f8eb
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-20.04
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 libavifile-0.7c2 libopenjpip7 imagemagick libvips-tools
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@v2
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
@@ -2,5 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  group :jekyll_plugins do
4
4
  gem 'github-pages'
5
- gem 'jekyll-rtd-theme'
6
5
  end
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: rundocs/jekyll-rtd-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.
@@ -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
- * We now use the libvips
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
- * Geometry is renamed to 'crop', and reduced to simple aspect ratios only. (`width:height`)
40
- * Gravity is gone, replaced by 'keep' which is translated to a libvips
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 `$ convert --version`_.
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
+ ```
@@ -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?('convert')
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
- system("which #{command} > /dev/null 2>&1")
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
@@ -1,3 +1,3 @@
1
1
  module PictureTag
2
- VERSION = '2.1.2'.freeze
2
+ VERSION = '2.1.3'.freeze
3
3
  end
data/package-lock.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "jekyll_picture_tag",
3
+ "lockfileVersion": 3,
4
+ "requires": true,
5
+ "packages": {}
6
+ }
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
- Recent releases:
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.2
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: 2024-09-13 00:00:00.000000000 Z
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.3.20
420
+ rubygems_version: 3.4.19
433
421
  signing_key:
434
422
  specification_version: 4
435
423
  summary: Easy responsive images for Jekyll.