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

Fixed .webp src creation for svg and other files #2698

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

KingHowler
Copy link
Contributor

@KingHowler KingHowler commented Sep 13, 2024

Added a default srcset in case extension is other than the following:

  • .jpg
  • .jpeg
  • .png
  • .tiff
  • .gif

fixed #2660

@KingHowler KingHowler changed the title Fixed #2660 Fixed .webp src creation for svg and other files Sep 13, 2024
@KingHowler
Copy link
Contributor Author

@george-gca, kindly review this

_includes/figure.liquid Show resolved Hide resolved
_includes/figure.liquid Show resolved Hide resolved
@george-gca george-gca merged commit 0465459 into alshedivat:master Sep 13, 2024
3 checks passed
@george-gca
Copy link
Collaborator

Thanks for the fix. Did you find if this fixes the faulty </source> tags?

@KingHowler
Copy link
Contributor Author

Unfortunately they can't be fixed. It's not an issue with al-folio, but an issue with the language Liquid

What we can do is use a GitHub action to correct it. I have already done that in the gh-pages formater workflow.

meiqing-wang pushed a commit to meiqing-wang/meiqing-wang.github.io that referenced this pull request Oct 13, 2024
Added a default srcset in case extension is other than the following:
- .jpg
- .jpeg
- .png
- .tiff
- .gif

fixed alshedivat#2660
george-gca pushed a commit that referenced this pull request Oct 22, 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

- Fixes #2777

Please review the changes and let me know if there are any further
adjustments needed. Thank you!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vector images not generating webp files
2 participants