Skip to content

Commit 125f1b7

Browse files
committed
Add gallery support for JPEGXL
1 parent 38fbd2e commit 125f1b7

File tree

8 files changed

+12
-6
lines changed

8 files changed

+12
-6
lines changed

templates/forms/misc/--variables--gallery.txp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ Default (undefined) is 2rem gap between grid cells.
1313

1414
<txp:hide>
1515
GALLERY PROGRESSIVELY ENHANCED IMAGE FORMATS -----------------------------------
16-
All possible (comma seperated) values: 'avif', 'webp'. (e.g. 'avif, webp').
16+
All possible (comma seperated) values: 'avif', 'webp', 'jxl'. (e.g. 'webp,jxl').
1717
Default (undefined) = no additional image formats.
1818
To use modern image formats in addition to legacy image formats, please manually
1919
upload versions of your images using identical ID numbering (e.g. if you have a
20-
'24.jpg' image, manually upload a '24.avif' and/or '24.webp' image to the same
21-
image directory).
20+
'24.jpg' image, manually upload a '24.avif' and/or '24.webp' and/or '24.jxl'
21+
image to the same image directory).
2222
</txp:hide>
2323
<txp:variable name="--gallery-additional-img-formats" value="" />

templates/forms/misc/-module--gallery--carousel.txp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<li class="glide__slide">
99
<txp:if_variable name="--gallery-additional-img-formats" not value="">
1010
<picture>
11+
<txp:if_variable name="--gallery-additional-img-formats" match="any" value="jxl"><source srcset="<txp:image_url trim="/\.(gif|png|jpe?g)$/" />.jxl" type="image/jxl" /></txp:if_variable>
1112
<txp:if_variable name="--gallery-additional-img-formats" match="any" value="avif"><source srcset="<txp:image_url trim="/\.(gif|png|jpe?g)$/" />.avif" type="image/avif" /></txp:if_variable>
1213
<txp:if_variable name="--gallery-additional-img-formats" match="any" value="webp"><source srcset="<txp:image_url trim="/\.(gif|png|jpe?g)$/" />.webp" type="image/webp" /></txp:if_variable>
1314
<img decoding="async" src="<txp:image_url />" alt="<txp:image_info type='alt' />" itemprop="image">

templates/forms/misc/-module--gallery--grid.txp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<div class="layout-<txp:variable name="--gallery-columns" />col">
88
<txp:if_variable name="--gallery-additional-img-formats" not value="">
99
<picture>
10+
<txp:if_variable name="--gallery-additional-img-formats" match="any" value="jxl"><source srcset="<txp:image_url trim="/\.(gif|png|jpe?g)$/" />.jxl" type="image/jxl" /></txp:if_variable>
1011
<txp:if_variable name="--gallery-additional-img-formats" match="any" value="avif"><source srcset="<txp:image_url trim="/\.(gif|png|jpe?g)$/" />.avif" type="image/avif" /></txp:if_variable>
1112
<txp:if_variable name="--gallery-additional-img-formats" match="any" value="webp"><source srcset="<txp:image_url trim="/\.(gif|png|jpe?g)$/" />.webp" type="image/webp" /></txp:if_variable>
1213
<img loading="lazy" src="<txp:image_url />" alt="<txp:image_info type='alt' />" itemprop="image">

templates/forms/misc/-module--gallery--vertical-masonry.txp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<txp:images category="gallery" break="" sort="date desc" limit="96">
77
<txp:if_variable name="--gallery-additional-img-formats" not value="">
88
<picture>
9+
<txp:if_variable name="--gallery-additional-img-formats" match="any" value="jxl"><source srcset="<txp:image_url trim="/\.(gif|png|jpe?g)$/" />.jxl" type="image/jxl" /></txp:if_variable>
910
<txp:if_variable name="--gallery-additional-img-formats" match="any" value="avif"><source srcset="<txp:image_url trim="/\.(gif|png|jpe?g)$/" />.avif" type="image/avif" /></txp:if_variable>
1011
<txp:if_variable name="--gallery-additional-img-formats" match="any" value="webp"><source srcset="<txp:image_url trim="/\.(gif|png|jpe?g)$/" />.webp" type="image/webp" /></txp:if_variable>
1112
<img loading="lazy" src="<txp:image_url />" alt="<txp:image_info type='alt' />" itemprop="image">

themes/hive-framework-0.0.9/forms/misc/--variables--gallery.txp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ Default (undefined) is 2rem gap between grid cells.
1313

1414
<txp:hide>
1515
GALLERY PROGRESSIVELY ENHANCED IMAGE FORMATS -----------------------------------
16-
All possible (comma seperated) values: 'avif', 'webp'. (e.g. 'avif,webp').
16+
All possible (comma seperated) values: 'avif', 'webp', 'jxl'. (e.g. 'webp,jxl').
1717
Default (undefined) = no additional image formats.
1818
To use modern image formats in addition to legacy image formats, please manually
1919
upload versions of your images using identical ID numbering (e.g. if you have a
20-
'24.jpg' image, manually upload a '24.avif' and/or '24.webp' image to the same
21-
image directory).
20+
'24.jpg' image, manually upload a '24.avif' and/or '24.webp' and/or '24.jxl'
21+
image to the same image directory).
2222
</txp:hide>
2323
<txp:variable name="--gallery-additional-img-formats" value="" />

themes/hive-framework-0.0.9/forms/misc/-module--gallery--carousel.txp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<li class="glide__slide">
99
<txp:if_variable name="--gallery-additional-img-formats" not value="">
1010
<picture>
11+
<txp:if_variable name="--gallery-additional-img-formats" match="any" value="jxl"><source srcset="<txp:image_url trim="/\.(gif|png|jpe?g)$/" />.jxl" type="image/jxl" /></txp:if_variable>
1112
<txp:if_variable name="--gallery-additional-img-formats" match="any" value="avif"><source srcset="<txp:image_url trim="/\.(gif|png|jpe?g)$/" />.avif" type="image/avif" /></txp:if_variable>
1213
<txp:if_variable name="--gallery-additional-img-formats" match="any" value="webp"><source srcset="<txp:image_url trim="/\.(gif|png|jpe?g)$/" />.webp" type="image/webp" /></txp:if_variable>
1314
<img decoding="async" src="<txp:image_url />" alt="<txp:image_info type='alt' />" itemprop="image">

themes/hive-framework-0.0.9/forms/misc/-module--gallery--grid.txp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<div class="layout-<txp:variable name="--gallery-columns" />col">
88
<txp:if_variable name="--gallery-additional-img-formats" not value="">
99
<picture>
10+
<txp:if_variable name="--gallery-additional-img-formats" match="any" value="jxl"><source srcset="<txp:image_url trim="/\.(gif|png|jpe?g)$/" />.jxl" type="image/jxl" /></txp:if_variable>
1011
<txp:if_variable name="--gallery-additional-img-formats" match="any" value="avif"><source srcset="<txp:image_url trim="/\.(gif|png|jpe?g)$/" />.avif" type="image/avif" /></txp:if_variable>
1112
<txp:if_variable name="--gallery-additional-img-formats" match="any" value="webp"><source srcset="<txp:image_url trim="/\.(gif|png|jpe?g)$/" />.webp" type="image/webp" /></txp:if_variable>
1213
<img loading="lazy" src="<txp:image_url />" alt="<txp:image_info type='alt' />" itemprop="image">

themes/hive-framework-0.0.9/forms/misc/-module--gallery--vertical-masonry.txp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<txp:images category="gallery" break="" sort="date desc" limit="96">
77
<txp:if_variable name="--gallery-additional-img-formats" not value="">
88
<picture>
9+
<txp:if_variable name="--gallery-additional-img-formats" match="any" value="jxl"><source srcset="<txp:image_url trim="/\.(gif|png|jpe?g)$/" />.jxl" type="image/jxl" /></txp:if_variable>
910
<txp:if_variable name="--gallery-additional-img-formats" match="any" value="avif"><source srcset="<txp:image_url trim="/\.(gif|png|jpe?g)$/" />.avif" type="image/avif" /></txp:if_variable>
1011
<txp:if_variable name="--gallery-additional-img-formats" match="any" value="webp"><source srcset="<txp:image_url trim="/\.(gif|png|jpe?g)$/" />.webp" type="image/webp" /></txp:if_variable>
1112
<img loading="lazy" src="<txp:image_url />" alt="<txp:image_info type='alt' />" itemprop="image">

0 commit comments

Comments
 (0)