jekyll-imgflow 0.4.5 → 0.4.6
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/CHANGELOG.md +31 -0
- data/interface.yml +7 -1
- data/lib/jekyll-imgflow/imgflow_tag.rb +5 -6
- data/lib/jekyll-imgflow/interface.rb +6 -3
- data/lib/jekyll-imgflow/intrinsic_dimensions.rb +1 -1
- data/lib/jekyll-imgflow/parser.rb +7 -1
- data/lib/jekyll-imgflow/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3621006b4abf29db3e72bfba32b38fd73a5077f4262642eb9be687513bba8102
|
|
4
|
+
data.tar.gz: 5035b5c73b7c78d4065ec29cf7291374a20ce23281d7aa067c01385c5699cd03
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 592fe554a1c349ec9a99cc803483616b07d76bd78bb2512a0ba66df7a5278b74bf650b26f27448656acfbdd85b39eb187bf5f9bbc3a6ed862ddb351d0c4fb809
|
|
7
|
+
data.tar.gz: 7eded76e45d4869bfb3dd531c478bc08fdba60a050d534795fc7af6ae108992815237d2a9836a3e609cc40ed542963e86ec177fbccdef102b2383d56dcbc6325
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.4.6] - 2026-11-16
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `interface.yml` now exposes `tags.imgflow.param_prefixes`
|
|
8
|
+
(`a-`, `img-`, `parent-`, `picture-`, `source-`) so editor tooling can
|
|
9
|
+
recognize element-scoped attributes instead of flagging them as
|
|
10
|
+
unknown params.
|
|
11
|
+
- `docs/usage/tag-options.md`: element-scoped attribute table
|
|
12
|
+
(`img-*:`/`picture-*:`/`source-*:`/`a-*:`/`parent-*:`).
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- `{% imgflow %}` no longer emits duplicated attributes on the generated
|
|
17
|
+
`<img>` element. `extract_element_attributes` kept `alt`, `link`, and
|
|
18
|
+
`modal` in the per-element attribute bucket as symbol keys while
|
|
19
|
+
`base_img_attrs` merged string-keyed generated attributes, so the
|
|
20
|
+
output carried e.g. both `alt="…"` twice and `loading="eager"` plus a
|
|
21
|
+
spurious `loading="lazy"`. The tag now strips control options from the
|
|
22
|
+
`img` attribute set and normalizes its keys to strings; `loading:eager`
|
|
23
|
+
is respected and the `modal="false"` control option no longer leaks as
|
|
24
|
+
a literal attribute.
|
|
25
|
+
- Element-prefixed attributes in `{% imgflow %}` markup
|
|
26
|
+
(`picture-class:`, `source-*:`, `a-*:`, `parent-*:`, `img-*:`) are no
|
|
27
|
+
longer silently dropped. `Parser.extract_html_attributes` only kept
|
|
28
|
+
the scalar attribute whitelist, so prefixed keys never reached the
|
|
29
|
+
tag — breaking the documented element-attribute syntax and the Jekyll
|
|
30
|
+
Picture Tag compatibility attributes (`img-class:`/`picture-class:`)
|
|
31
|
+
emitted by `PictureTagAdaptor`. `img-*` keys are now stripped of the
|
|
32
|
+
prefix into the `<img>` attribute set.
|
|
33
|
+
|
|
3
34
|
## [0.4.5] - 2026-11-10
|
|
4
35
|
|
|
5
36
|
### Added
|
data/interface.yml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Public tag/config surface for tooling (editor extensions, doc linters).
|
|
3
3
|
---
|
|
4
4
|
gem: jekyll-imgflow
|
|
5
|
-
version: 0.4.
|
|
5
|
+
version: 0.4.6
|
|
6
6
|
tags:
|
|
7
7
|
imgflow:
|
|
8
8
|
params:
|
|
@@ -27,6 +27,12 @@ tags:
|
|
|
27
27
|
- title
|
|
28
28
|
- watermark
|
|
29
29
|
- width
|
|
30
|
+
param_prefixes:
|
|
31
|
+
- a-
|
|
32
|
+
- img-
|
|
33
|
+
- parent-
|
|
34
|
+
- picture-
|
|
35
|
+
- source-
|
|
30
36
|
filters: []
|
|
31
37
|
config:
|
|
32
38
|
imgflow:
|
|
@@ -261,17 +261,16 @@ module Jekyll
|
|
|
261
261
|
base_attrs = parsed[:html_attributes] || {}
|
|
262
262
|
|
|
263
263
|
# Build element-specific attribute structure
|
|
264
|
+
prefixes = JekyllImgFlow::Parser::ELEMENT_ATTR_PREFIXES
|
|
264
265
|
{
|
|
265
|
-
img: base_attrs.
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
img: base_attrs.transform_keys(&:to_s).except("alt", "link", "modal")
|
|
267
|
+
.reject { |k, _v| k.start_with?(*prefixes) }
|
|
268
|
+
.merge(extract_prefixed_attrs(base_attrs, "img-")),
|
|
268
269
|
picture: extract_prefixed_attrs(base_attrs, "picture-"),
|
|
269
270
|
source: extract_prefixed_attrs(base_attrs, "source-"),
|
|
270
271
|
a: extract_prefixed_attrs(base_attrs, "a-"),
|
|
271
272
|
parent: extract_prefixed_attrs(base_attrs, "parent-"),
|
|
272
|
-
alt: base_attrs[:alt],
|
|
273
|
-
link: base_attrs[:link],
|
|
274
|
-
modal: base_attrs[:modal],
|
|
273
|
+
alt: base_attrs[:alt], link: base_attrs[:link], modal: base_attrs[:modal],
|
|
275
274
|
modal_results: parsed[:modal_results] || []
|
|
276
275
|
}
|
|
277
276
|
end
|
|
@@ -7,8 +7,11 @@ module JekyllImgFlow
|
|
|
7
7
|
# tooling like editor extensions can consume it without parsing Ruby.
|
|
8
8
|
module Interface
|
|
9
9
|
TAGS = {
|
|
10
|
-
"imgflow" =>
|
|
11
|
-
|
|
10
|
+
"imgflow" => {
|
|
11
|
+
"params" => (Parser::OPERATION_PARAMS + Parser::HTML_ATTRIBUTES + %i[markup])
|
|
12
|
+
.map(&:to_s).sort.freeze,
|
|
13
|
+
"param_prefixes" => Parser::ELEMENT_ATTR_PREFIXES
|
|
14
|
+
}
|
|
12
15
|
}.freeze
|
|
13
16
|
|
|
14
17
|
# Config keys read outside CORE_CONFIG_DEFAULTS in config.rb
|
|
@@ -21,7 +24,7 @@ module JekyllImgFlow
|
|
|
21
24
|
{
|
|
22
25
|
"gem" => "jekyll-imgflow",
|
|
23
26
|
"version" => VERSION,
|
|
24
|
-
"tags" => TAGS
|
|
27
|
+
"tags" => TAGS,
|
|
25
28
|
"filters" => [],
|
|
26
29
|
"config" => {
|
|
27
30
|
"imgflow" => (Config::CORE_CONFIG_DEFAULTS.keys + EXTRA_CONFIG_KEYS).sort
|
|
@@ -24,7 +24,7 @@ module JekyllImgFlow
|
|
|
24
24
|
private
|
|
25
25
|
|
|
26
26
|
def base_img_attrs(result = nil)
|
|
27
|
-
attrs = @attributes[:img].
|
|
27
|
+
attrs = @attributes[:img].transform_keys(&:to_s)
|
|
28
28
|
attrs["alt"] = @attributes[:alt] if @attributes[:alt]
|
|
29
29
|
inject_intrinsic_dimensions(attrs, result)
|
|
30
30
|
attrs
|
|
@@ -11,6 +11,10 @@ module JekyllImgFlow
|
|
|
11
11
|
optimize level watermark opacity position keep preset].freeze
|
|
12
12
|
HTML_ATTRIBUTES = %i[alt class title loading link modal].freeze
|
|
13
13
|
|
|
14
|
+
# Element-scoped attribute prefixes routed to specific markup elements
|
|
15
|
+
ELEMENT_ATTR_PREFIXES = %w[a- img- parent- picture- source-].freeze
|
|
16
|
+
ELEMENT_ATTR_PATTERN = /\A(?:a|img|parent|picture|source)-/
|
|
17
|
+
|
|
14
18
|
# Simple operation mappings for single-parameter operations
|
|
15
19
|
SIMPLE_OPERATIONS = {
|
|
16
20
|
quality: ->(val) { { type: :quality, params: { quality: val } } },
|
|
@@ -158,7 +162,9 @@ module JekyllImgFlow
|
|
|
158
162
|
end
|
|
159
163
|
|
|
160
164
|
def self.extract_html_attributes(options)
|
|
161
|
-
options.slice(*HTML_ATTRIBUTES)
|
|
165
|
+
options.slice(*HTML_ATTRIBUTES).merge(
|
|
166
|
+
options.select { |k, _v| k.to_s.match?(ELEMENT_ATTR_PATTERN) }
|
|
167
|
+
)
|
|
162
168
|
end
|
|
163
169
|
|
|
164
170
|
def self.extract_image_path(options, markup)
|