From b3f1968422d5689b79f921a417a2f4b4da6b4acf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Fuch=C3=9F?= Date: Tue, 22 Oct 2024 15:42:20 +0200 Subject: [PATCH] Fix .webp SrcSet Creation Filter (#2761) ### Pull Request: Fix .webp SrcSet Creation Filter #### Description This PR addresses an issue with the filter for creating `.webp` srcsets introduced in PR #2698. The original filter incorrectly searched for extensions with a leading period (e.g., ".jpg" and ".png"). As a result, no matches were found, preventing the srcset from being added to any figures. This occurred because the split operation removes the period from the file extensions. #### Changes Made - Updated the filter to search for file extensions without the leading period (e.g., "jpg" and "png"). - Ensured that the resource sets are now correctly created for the respective file extensions, allowing the `.webp` srcset to function as intended. #### Impact With this change, responsive images will now correctly generate their srcsets for the appropriate file types, improving image loading performance and supporting better responsiveness. #### Fixes - Fixes #2777 Please review the changes and let me know if there are any further adjustments needed. Thank you! --- _includes/figure.liquid | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_includes/figure.liquid b/_includes/figure.liquid index a8d54dab5dbd..a6f55a86e01e 100644 --- a/_includes/figure.liquid +++ b/_includes/figure.liquid @@ -16,7 +16,8 @@ {% if site.imagemagick.enabled %}