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

Optimize images #323

Merged
merged 3 commits into from
Dec 15, 2024
Merged

Optimize images #323

merged 3 commits into from
Dec 15, 2024

Conversation

rossta
Copy link
Contributor

@rossta rossta commented Dec 15, 2024

Many of the static content images are too big.

This PR adds a very rough script script/convert-webp for running locally that uses Imagemagick to generate optimized images if possible.

Example usage:

$ bundle exec script/convert-webp app/assets/images/**/*

I ran the script on current jpg/png under app/assets/images.

This PR also a Phlex component Content::Image that attempts to render an optimized version of the image if it exists on disk. This component is now used in articles and on the homepage and article index pages.

Copy images to article image dir

Generate optimized article images

Add hatchbox optimized images

Add logic to render webp in articles

Update optimize script and article images

Remove webp images

Update image script to detect size

Update script and optimized images with smarts
@rossta rossta merged commit d52eb12 into main Dec 15, 2024
9 checks passed
@rossta rossta deleted the feat/optimize-images branch December 15, 2024 12:03
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.

1 participant