jekyll_picture_tag 2.1.1 → 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: 30a2a1abb695fc9b9478a3b5a89d9d04fcac60bc2f26be01e75ab8bd986ca066
4
- data.tar.gz: 790b247444046c015fcb64e791b5ae63bc861e7fa94ef471bcda730912cf30ac
3
+ metadata.gz: 9ccbffcf313082eec49e27ba5e80d9b6f5d6727dda3125562c5822209eea8cec
4
+ data.tar.gz: b1c68f683fd243b960a9d15a7556927175fcdd9a94f2e3438b32d543beb56ebf
5
5
  SHA512:
6
- metadata.gz: 8a189f75d899129943f345cc002c2513f82845725b9de682dc17d6ff4e7db157647743ad09ca0bbba66ff1650e41a38b9f066c6523bf929b73f1cba6e2f3bcde
7
- data.tar.gz: 7118cd37ec049eb909147ad17d8a43e37181aa36f38f76f2a7f9fcb542b6d5a79926a4a8d2e6f2e78e80e789845a41fa5f16508d572e50c26eacc87d0d31450e
6
+ metadata.gz: d821c75305bb4d3022fab0f5bbba9503f05280d01c16414c91eb00d78746367612236c11d09eb7b34b2a10ec2d16349d91676756e313c85c60e7602c26b69078
7
+ data.tar.gz: cdd31c120638ebeaed12cb9d37bf7196997d8f6b05f33c2eaba3940e01915921e3d665d2f5cc041f5ed80b0ecdcae1d65bc99140887e7832a43d66b1a748c935
@@ -2,24 +2,21 @@ name: 'Tests & Formatting'
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [ master ]
5
+ branches: [master]
6
6
  pull_request:
7
- branches: [ master ]
8
- schedule:
9
- # Run weekly; github deletes caches that haven't been used in a week.
10
- - cron: '0 0 * * 0'
7
+ branches: [master]
11
8
 
12
9
  jobs:
13
10
  checks:
14
- runs-on: ubuntu-20.04
11
+ runs-on: ubuntu-22.04
15
12
 
16
13
  steps:
17
14
 
18
15
  - name: Install system dependencies
19
- 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
20
17
 
21
18
  - name: Checkout repo
22
- uses: actions/checkout@v2
19
+ uses: actions/checkout@v4
23
20
 
24
21
  # Version taken from .ruby-version file.
25
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,11 +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)
7
+ * 2.1.2 13 September, 2024
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)
5
9
  * 2.1.1 20 July, 2024
6
10
  * Don't provide Q setting for PPM images - thanks to @dichiban for [#309](https://github.com/rbuchberger/jekyll_picture_tag/pull/309)
7
11
  * Fix alpha premultiplication - thanks to @KaarlisCaune for [#302](https://github.com/rbuchberger/jekyll_picture_tag/pull/302)
8
12
  * 2.1.0 29 January, 2024
9
- * 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
10
14
  [#299](https://github.com/rbuchberger/jekyll_picture_tag/pull/299)
11
15
  * Update minimum required mocha version to maintain compatibility with minitest
12
16
  * 2.0.4 August 16, 2022
@@ -31,11 +35,11 @@
31
35
  * Require Ruby >= 2.6, support Ruby 3.0
32
36
  * Require Jekyll >= 4.0
33
37
  * Cropping is changing.
34
- * We now use the libvips
38
+ * We now use the libvips
35
39
  [smartcrop function](https://www.rubydoc.info/gems/ruby-vips/Vips/Image#smartcrop-instance_method),
36
40
  which does some magic to keep the most useful part of the image.
37
- * Geometry is renamed to 'crop', and reduced to simple aspect ratios only. (`width:height`)
38
- * 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
39
43
  [interestingness](https://www.rubydoc.info/gems/ruby-vips/Vips/Interesting) setting.
40
44
  * Add stock presets and media queries, under the `jpt-` prefix.
41
45
  * Add `format_quality` default settings for webp, avif, and jp2.
data/docs/index.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  ---
3
3
 
4
- ![](logo.svg)
4
+ ![](logo.png)
5
5
 
6
6
  _Responsive Images, Done Correctly._
7
7
 
data/docs/logo.png CHANGED
Binary file
@@ -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
+ ```
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
38
38
  # rainbow is used to colorize terminal output.
39
39
  spec.add_runtime_dependency 'rainbow', '~> 3.0'
40
40
  # ruby-vips interfaces with libvips.
41
- spec.add_runtime_dependency 'ruby-vips', '~> 2.0.17'
41
+ spec.add_runtime_dependency 'ruby-vips', '~> 2.2'
42
42
 
43
43
  # libvips handles all image processing operations.
44
44
  spec.requirements << 'libvips'
@@ -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.1'.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
@@ -1,31 +1,18 @@
1
1
  # Jekyll Picture Tag
2
2
 
3
- ## Help Wanted
4
-
5
- My life just got a lot busier; I'd really like a maintainer or two to help. I'm not abandoning JPT,
6
- I just don't have a ton of time to put into hacking on it.
7
-
8
- If you've been learning Ruby and you want to move beyond tutorials and throwaway projects, I'd love
9
- to hear from you. I'd be happy to help you gain experience and credibility, if you're willing to
10
- help me maintain this project!
11
-
12
- If you're interested, contact me: robert@buchberger.cc
13
-
14
- ![Logo](docs/logo.svg)
15
-
16
- ![Tests & Formatting](https://github.com/rbuchberger/jekyll_picture_tag/workflows/Tests%20&%20Formatting/badge.svg)
17
-
18
3
  **Responsive Images done correctly.**
19
4
 
20
- It's simple to throw a photo on a page and call it a day, but doing justice to users on all
21
- different browsers and devices is tedious and tricky. Tedious, tricky things should be automated.
22
- [This blog post further elaborates on that theme.](https://robert-buchberger.com/blog/2021/responsive_images.html)
5
+ ![Logo](docs/logo.png)
23
6
 
24
7
  Jekyll Picture Tag automatically builds cropped, resized, and reformatted images, builds several
25
8
  kinds of markup, offers extensive configuration while requiring none, and solves both the art
26
9
  direction and resolution switching problems with a little YAML configuration and a simple template
27
10
  tag.
28
11
 
12
+ It's simple to throw a photo on a page and call it a day, but doing justice to users on all
13
+ different browsers and devices is tedious and tricky.
14
+ [Tedious, tricky things should be automated](https://robert-buchberger.com/blog/2021/responsive_images.html).
15
+
29
16
  ## Why use Responsive Images?
30
17
 
31
18
  **Performance:** The fastest sites are static sites, but if you plonk a 2mb picture of your dog at
@@ -57,13 +44,17 @@ Tag is your responsive images minion - give it simple instructions and it'll han
57
44
 
58
45
  <https://rbuchberger.github.io/jekyll_picture_tag/devs/releases>
59
46
 
60
- Recent releases:
47
+ 2.0 and later releases:
61
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)
51
+ * 2.1.2 13 September, 2024
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)
62
53
  * 2.1.1 20 July, 2024
63
- * Don't provide Q setting for PPM images - thanks to @dichiban for [#309](https://github.com/rbuchberger/jekyll_picture_tag/pull/309)
64
- * Fix alpha premultiplication - thanks to @KaarlisCaune for [#302](https://github.com/rbuchberger/jekyll_picture_tag/pull/302)
54
+ * Don't provide Q setting for PPM images - thanks to [@dichiban](https://github.com/dichiban) for [#309](https://github.com/rbuchberger/jekyll_picture_tag/pull/309)
55
+ * Fix alpha premultiplication - thanks to [@KaarlisCaune](https://github.com/kaarliscaune) for [#302](https://github.com/rbuchberger/jekyll_picture_tag/pull/302)
65
56
  * 2.1.0 29 January, 2024
66
- * Check whether the vips CLI is installed before trying to use it. Thanks to @philrb for
57
+ * Check whether the vips CLI is installed before trying to use it. Thanks to [@philrb](https://github.com/philrb) for
67
58
  [#299](https://github.com/rbuchberger/jekyll_picture_tag/pull/299)
68
59
  * Update minimum required mocha version to maintain compatibility with minitest
69
60
  * 2.0.4 August 16, 2022
@@ -103,11 +94,3 @@ Recent releases:
103
94
  * Drop support for `markup_presets` and `media_presets`. They are now
104
95
  officially and only `presets` and `media_queries`.
105
96
  * Improve docs with an introductory tutorial and 'how-to' flow.
106
-
107
- ## Help Wanted
108
-
109
- Writing code is only part of the job; often the harder part is knowing what needs to be changed. Any
110
- and all feedback is greatly appreciated, especially in regards to documentation. What are your pain
111
- points? See the [contributing
112
- guidelines](https://rbuchberger.github.io/jekyll_picture_tag/devs/contributing), or the
113
- [issues](https://github.com/rbuchberger/jekyll_picture_tag/issues) page for more.
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.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: 2024-07-20 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
@@ -88,14 +88,14 @@ dependencies:
88
88
  requirements:
89
89
  - - "~>"
90
90
  - !ruby/object:Gem::Version
91
- version: 2.0.17
91
+ version: '2.2'
92
92
  type: :runtime
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - "~>"
97
97
  - !ruby/object:Gem::Version
98
- version: 2.0.17
98
+ version: '2.2'
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: bundler
101
101
  requirement: !ruby/object:Gem::Requirement
@@ -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
@@ -311,7 +297,6 @@ files:
311
297
  - docs/devs/releases.md
312
298
  - docs/index.md
313
299
  - docs/logo.png
314
- - docs/logo.svg
315
300
  - docs/users/configuration/directories.md
316
301
  - docs/users/configuration/disable.md
317
302
  - docs/users/configuration/fast_build.md
@@ -357,6 +342,7 @@ files:
357
342
  - docs/users/presets/nomarkdown_override.md
358
343
  - docs/users/presets/pixel_ratio_srcsets.md
359
344
  - docs/users/presets/quality_width_graph.png
345
+ - docs/users/presets/subpresets.md
360
346
  - docs/users/presets/width_height_attributes.md
361
347
  - docs/users/presets/width_srcsets.md
362
348
  - docs/users/presets/writing_presets.md
@@ -405,6 +391,7 @@ files:
405
391
  - lib/jekyll_picture_tag/srcsets/width.rb
406
392
  - lib/jekyll_picture_tag/utils.rb
407
393
  - lib/jekyll_picture_tag/version.rb
394
+ - package-lock.json
408
395
  - readme.md
409
396
  homepage: https://github.com/rbuchberger/jekyll_picture_tag
410
397
  licenses:
@@ -430,7 +417,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
430
417
  version: '0'
431
418
  requirements:
432
419
  - libvips
433
- rubygems_version: 3.3.20
420
+ rubygems_version: 3.4.19
434
421
  signing_key:
435
422
  specification_version: 4
436
423
  summary: Easy responsive images for Jekyll.