How can I load image_tag data for a variable-assigned image?

I have assigned a variable:

{% assign logologo = ‘yyy.png’ %}

I can call it using <img src:

Image

But i cant seem to be able to load it using the image_url tag:

{{ logologo | image_url: width: 600 | image_tag:
class: ‘header__heading-logo motion-reduce’,
widths: widths,
height: logo_height,
width: settings.logo_width,
alt: logo_alt,
sizes: sizes,
preload: true
}}

How do i need to modify the variable string to get this working or how else can i load the image_tag data for such image?

hi @pandapanda8
Its SideNode! We will be happy to help you today.
You can try this code: it will be helpful to you

{% assign logologo = 'assets/yyy.png' %}

{{ logologo | image_url: width: 600 | image_tag:
class: 'header__heading-logo motion-reduce',
width: settings.logo_width,
alt: logo_alt,
preload: true
}}

If I was able to assist you, please remember to give it a Like and Mark it as the Solution!

Let me know if need further assistance
Regards,
SideNode