I have a flask app with a jinja macro that looks like that
{% macro icon(site, title="") %}
<img src="{{ url_for('static', filename="icons/XXX.png") }}" alt="{{ title }}" class="img-icon">
{% endmacro %}
What I need to do is have the filename equals to the site variable passed to the macro. so instead of the XXX it should have the value of site.
Is there a way to do that?
This should work: