Skip to content

Conversation

@ssddanbrown
Copy link
Contributor

@ssddanbrown ssddanbrown commented Dec 29, 2025

This is a follow-up and improvement to my PR yesterday in #37. See that for context.
Instead of manually needing image conversion, with loads of extra images in the repo, this auto-generates optimized webp images via Hugo.

This does mean that initial hugo builds can take a while extra, but rendered images are cached by Hugo so that typically only takes time during the first run, unless extra images have been added since.

This also sets image dimensions (auto-extracted from the hugo build process) on the images on the portfolio templates, so their dimension/aspect ratio are known to the browser, allowing browser-native lazy loading to be applied without messing up the masonry layout.

Reduces main page load from 103MB to 5.28MB, potentially less if the browser uses lazy loading.

This updates the portfolio partial to use thuamnail images which are
generated via Hugo's build system so that optimized images are used
instead.

Reduces main page load from 103MB to 5.28MB.
Does not need manually handled/optimized images.
@ssddanbrown ssddanbrown mentioned this pull request Dec 29, 2025
@handyrandyrc
Copy link
Contributor

Cannot upvote this enough. Really cool, @ssddanbrown

@jtrmal
Copy link
Owner

jtrmal commented Jan 14, 2026

Indeed, this is very cool. My bad that I didin't care about the image sizes and I really appreciate your work on this. Merging.

@jtrmal jtrmal merged commit 670e9df into jtrmal:main Jan 14, 2026
1 check 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.

3 participants