Static images now use flask url_for to get url

This commit is contained in:
2023-09-11 10:28:24 -04:00
parent 9610d995de
commit b6f7f7a2b7
6 changed files with 41 additions and 38 deletions

View File

@@ -21,15 +21,16 @@
<picture>
{% for img in page.get_content()[row]['images'] %}
{% if not loop.last %}
<source srcset="{{ img }}"
<source srcset="{{ url_for('static', filename=img) }}"
media="(max-width: {{ config.IMG_BREAKPOINTS[loop.index] }})" />
{% else %}
<source srcset="{{ img }}"
<source srcset="{{ url_for('static', filename=img) }}"
media="(min-width: {{ config.IMG_BREAKPOINTS[loop.index] }})" />
{% endif %}
{% endfor %}
<img class="img-fluid" src="{{ page.get_content()[row]['images'][1] }}">
<img class="img-fluid"
src="{{ url_for('static', filename=page.get_content()[row]['images'][1]) }}">
</picture>
</div>
</div>