jekyll-imgwh 1.3.0 → 1.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '039fab28cf4794e19d2f2d706fe5cba88ac46b13c9330d06308a50f4078382e3'
4
- data.tar.gz: 18ed412a7b4cfbebbf1a424022df307691303ac5b067c758d22246214be8140e
3
+ metadata.gz: 7efeac12ff14b51441a976e3ea7b7d9c286d9429d59aeebfae72ed8666f7313c
4
+ data.tar.gz: 69f883d0d544d950cff948d71aeb5ff5333f11ad2810458b30a171192b9c50f4
5
5
  SHA512:
6
- metadata.gz: 3c215031cc7b9895731e059b14015dc10e5a565f1d29d2434e3e5b47224b851a09e068753ef5770fd16ef41f714d144d77ebdc31234abb85200f0f58617c7e77
7
- data.tar.gz: 972b7d444f27c163706b5527c22615bdddc6f0889d69460af73e0e950b6bd077d4325292cd51301ec1673ba66824108544fd7be29a178e62c8b00a7c199f69b8
6
+ metadata.gz: 1a0e4b3815bd80f84029a9f3ee4ca5237a9d70f4aa14f930914ddd134298eb1668da03b49e8a643aae8311c4cb4d5d970eea9af4d6ffbceaabf93360c07d2a66
7
+ data.tar.gz: 152ed5a03712c50cd8e412cd5c9892cbeac5317b7605489f0124df1a59d800908d4046b7704f8c035384f668a30988d89ebfe9ed6ceaa18f211d7393a79e9122
data/README.md CHANGED
@@ -69,8 +69,8 @@ For unquoted `<src>` whitespace is allowed only within Liquid filters (i.e. betw
69
69
 
70
70
  ```
71
71
  {% imgwh /f{{ 'oo' | append: ".png" }} %} -> OK (src=/foo.png)
72
- {% imgwh /My Site.png %} -> ERROR (tries to open "/My" image)
73
- {% imgwh /{{ site.title }}.png %} -> OK (src=/My Site.png)
72
+ {% imgwh /My Site.png %} -> ERROR (tries to open "/My" image)
73
+ {% imgwh /{{ site.title }}.png %} -> OK (src=/My Site.png)
74
74
  ```
75
75
 
76
76
  Note, in the last example, although plugin did not fire an error, generated `src` attribute is not valid (`<img>` element would use `src=/My`). After rendering Liquid markup in the `<src>` value, plugin does not perform any further normalization for the resulting URI. It is up to the caller to provide correct URI. Plugin only extracts and URL-decodes the path from it.
@@ -113,6 +113,8 @@ When the image path is relative, image is searched relative to the directory of
113
113
 
114
114
  When the image is not found, and a theme is used, and the path is absolute, image is also searched relative to the theme root directory.
115
115
 
116
+ For the local files, like Jekyll itself, plugin does not allow using files outside the source or theme root directories (in fact, plugin uses the path sanitize helpers from Jekyll). It will not be an immediate error in this case (for example, `"/../foo.png"` i.e. one level above the site root), but the image will be searched then in the source directory and the theme root directory no matter how many levels above the site root it is.
117
+
116
118
  ## Error Handling
117
119
 
118
120
  In case plugin cannot determine the image size (due to a syntax error, Liquid template error, image being nonexistent, not an image, etc.) it unconditionally raises an error which stops the site generation.
@@ -157,6 +159,8 @@ jekyll-imgwh:
157
159
  extra_rest: loading="lazy"
158
160
  ```
159
161
 
162
+ Like `<src>` and `<rest>`, `<extra_rest>` can also include Liquid markup, which is rendered in context of images where `<extra_rest>` is injected.
163
+
160
164
  # Troubleshooting
161
165
 
162
166
  When error is related to the image image file, plugin mentions the file path in the error message:
@@ -30,7 +30,7 @@ module Jekyll
30
30
 
31
31
  def resolve_path(path, context)
32
32
  local_path = path.start_with?("/") ? path : File.join(context.registers[:page]["dir"], path)
33
- local_path = File.join(context.registers[:site].source, local_path)
33
+ local_path = context.registers[:site].in_source_dir(local_path)
34
34
  debug "image path: '#{local_path}'"
35
35
  return local_path if File.file?(local_path)
36
36
 
@@ -3,6 +3,6 @@
3
3
  module Jekyll
4
4
  module Imgwh
5
5
  NAME = "jekyll-imgwh"
6
- VERSION = "1.3.0"
6
+ VERSION = "1.3.1"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-imgwh
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikalai Ananenka
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-04-24 00:00:00.000000000 Z
10
+ date: 2025-04-25 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: fastimage
@@ -122,7 +122,9 @@ files:
122
122
  homepage: https://github.com/ojuuji/jekyll-imgwh
123
123
  licenses:
124
124
  - MIT
125
- metadata: {}
125
+ metadata:
126
+ homepage_uri: https://github.com/ojuuji/jekyll-imgwh
127
+ bug_tracker_uri: https://github.com/ojuuji/jekyll-imgwh/issues
126
128
  rdoc_options: []
127
129
  require_paths:
128
130
  - lib
@@ -139,6 +141,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
141
  requirements: []
140
142
  rubygems_version: 3.6.2
141
143
  specification_version: 4
142
- summary: A tag for <img> elements with some automation, and a filter to get image
143
- size
144
+ summary: A tag for <img> element with some automation, and a filter returning image
145
+ size.
144
146
  test_files: []