{% load wagtailimages_tags %} {% spaceless %} {# use spaceless to avoid blank lines for image variables #} {# Generate responsive image using wagtail image template tag #} {# Expects Image as img; sizes per design spec #} {% image img max-291x438 as mobile_1x %} {% image img max-582x876 as mobile_2x %} {% image img max-718x1079 as tablet_1x %} {% image img max-1436x2158 as tablet_2x %} {% image img max-700x1051 as desktop_1x %} {% image img max-1400x2102 as desktop_2x %} {% firstof alt_text desktop_1x.alt %} {% endspaceless %}