Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix .webp SrcSet Creation Filter #2761

Merged
merged 4 commits into from
Oct 22, 2024

Conversation

dfuchss
Copy link
Contributor

@dfuchss dfuchss commented Oct 10, 2024

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

Please review the changes and let me know if there are any further adjustments needed. Thank you!

@dfuchss dfuchss changed the title Fix Bug in responsive-img-srcset Fix small bug regarding responsive-img-srcset Oct 11, 2024
@nWestie
Copy link
Contributor

nWestie commented Oct 13, 2024

^^ This - I came to fix this same issue, and found someone already got to it! simple fix.

@dfuchss dfuchss changed the title Fix small bug regarding responsive-img-srcset Fix .webp SrcSet Creation Filter Oct 14, 2024
_includes/figure.liquid Outdated Show resolved Hide resolved
@george-gca
Copy link
Collaborator

Just missing the prettier fix.

@dfuchss
Copy link
Contributor Author

dfuchss commented Oct 16, 2024

Just missing the prettier fix.

I don't know why prettier is requesting this because I only changed one line. But nevertheless, it's applied now.

@alshedivat alshedivat changed the base branch from master to main October 20, 2024 02:46
@george-gca george-gca merged commit b3f1968 into alshedivat:main Oct 22, 2024
3 checks passed
@dfuchss dfuchss deleted the bugfix/responsive-images branch October 22, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Responsive Image SrcSet Creation Not Functioning Properly
3 participants