Add responsive image optimization with WebP support
- Configure thumbs presets in config.php (quality 85%, WebP format) - Create picture snippet with srcset and WebP support - Add product-card and product-detail presets - Update templates to use optimized images - Implement native lazy loading for product cards - Add aspect-ratio CSS for layout stability Improvements over reference project: - Complete PHPDoc documentation - Native CSS aspect-ratio support - Optimized lazy loading strategy - Product-specific image presets 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
9c91a87720
commit
30d09d6104
4 changed files with 101 additions and 2 deletions
|
|
@ -10,7 +10,13 @@
|
|||
<article class="store__product">
|
||||
<figure>
|
||||
<?php if($image = $product->images()->first()): ?>
|
||||
<img src="<?= $image->url() ?>" alt="<?= $product->title()->html() ?>" />
|
||||
<?php snippet('picture', [
|
||||
'file' => $image,
|
||||
'alt' => $product->title()->html(),
|
||||
'preset' => 'product-card',
|
||||
'size' => 25,
|
||||
'lazy' => true
|
||||
]) ?>
|
||||
<?php endif ?>
|
||||
</figure>
|
||||
<p class="line-1"><a href="<?= $product->url() ?>"><?= $product->title()->html() ?></a></p>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue