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

Image attachments: use full-resolution file if available #87

Merged
merged 4 commits into from
Dec 4, 2024

Conversation

aurelienpierre
Copy link
Contributor

Images embedded in posts/pages may sometimes use downscaled image thumbnails or thumbnails sizes that don't exist anymore, patterned like some-file-1920x1080.jpg. We try to find the full-resolution image if any, like some-file.jpg, then fall-back to whatever URL was given in content if this failed.

This assumes Hugo image partials will handle resizing to theme width and responsive image sizes internally (see https://discourse.gohugo.io/t/hugo-image-processing-and-responsive-images/43110/4).

Images embedded in posts/pages may sometimes use downscaled image thumbnails or thumbnails sizes that don't exist anymore, patterned like `some-file-1920x1080.jpg`. We try to find the full-resolution image if any, like `some-file.jpg`, then fall-back to whatever URL was given in content if this failed.

This assumes Hugo image partials will handle resizing to theme width and responsive image sizes internally (see https://discourse.gohugo.io/t/hugo-image-processing-and-responsive-images/43110/4).
Copy link
Owner

@ashishb ashishb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution

@ashishb ashishb merged commit 9e1fe1e into ashishb:main Dec 4, 2024
3 checks passed
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.

2 participants