April 11, 2023
Cecil 7.35.0 released
Features
New asset filter and functions for images
Convert an image to the WebP format:
{{ asset|webp }}
Build srcset
attribute from an asset and retrieve available sizes
for a given class name:
{{ image_srcset(asset) }}
{{ image_sizes('class') }}
Example:
{% set photo = asset('photo.jpg') %}
<picture>
<source type="image/webp" srcset="{{ image_srcset(photo|webp) }}" sizes="{{ image_sizes('photo') }}">
<img src="{{ url(photo) }}" width="{{ photo.width }}" height="{{ photo.height }}" alt="" class="photo" srcset="{{ image_srcset(photo) }}" sizes="{{ image_sizes('photo') }}">
</picture>
Fix
- Disable
dataurl
filter for SVG
Release notes on GitHub