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 +4 -4
- data/README.md +6 -2
- data/lib/jekyll/imgwh/helpers.rb +1 -1
- data/lib/jekyll/imgwh/version.rb +1 -1
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7efeac12ff14b51441a976e3ea7b7d9c286d9429d59aeebfae72ed8666f7313c
|
4
|
+
data.tar.gz: 69f883d0d544d950cff948d71aeb5ff5333f11ad2810458b30a171192b9c50f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
73
|
-
{% imgwh
|
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:
|
data/lib/jekyll/imgwh/helpers.rb
CHANGED
@@ -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 =
|
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
|
|
data/lib/jekyll/imgwh/version.rb
CHANGED
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.
|
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-
|
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>
|
143
|
-
size
|
144
|
+
summary: A tag for <img> element with some automation, and a filter returning image
|
145
|
+
size.
|
144
146
|
test_files: []
|