{# Image-rendering macro, used both by templates (directly via import) and indirectly by the `img` shortcode (which forwards to it). With `width > 0`: resizes via Zola's image pipeline and emits explicit width/height attributes (good for large hero/preview images). With `width = 0` (default): emits a raw served from /static/images/ with no width/height attributes — lets the theme CSS size the image, which matches the live Grav site's pattern. Use this for content thumbnails that the theme styles responsively. #} {% macro render(src, width=0, alt="", class="") %} {%- set width = width | int -%} {%- if width > 0 -%} {%- set resized = resize_image(path="static/images/" ~ src, width=width, op="fit_width", quality=85) -%} {{ alt }} {%- else -%} {{ alt }} {%- endif -%} {% endmacro render %}