The Adritian theme includes a responsive-image shortcode that generates optimized <picture> elements with WebP conversion, multiple srcset widths, and lazy loading.
Basic usage
Place your images in the assets/ directory and reference them with the shortcode:

The shortcode above produces a <picture> element with:
- WebP srcset at 400w, 800w, and 1200w (up to the original image width)
- Original format srcset at the same widths
- Lazy loading via
loading="lazy"anddecoding="async" - CLS prevention via
widthandheightattributes
Custom sizes hint
Use the sizes parameter to give the browser a layout hint for which srcset entry to pick:

Adding CSS classes
Use the class parameter to style the image:

Static and external images
Images in static/ or external URLs fall back to a plain <img> with lazy loading (no srcset processing):
{{< responsive-image src="/img/blog/my-photo.jpg" alt="Static image" >}}Parameters
| Parameter | Description | Default |
|---|---|---|
src | Image path relative to assets/, page-bundle resource, or static/external URL | required |
alt | Alt text | "" |
class | CSS class(es) for the <img> element | – |
sizes | The sizes attribute for the browser layout hint | "100vw" |
For best results, place images in assets/ (e.g. assets/images/blog/) so Hugo Pipes can generate optimized variants.