2019-02-05 19:27:02 +01:00
{% if src %}
2023-05-11 06:21:49 +02:00
{# If the image's URL is internal to the site... #}
{% if src is not starting_with("http") %}
2023-06-16 22:32:17 +02:00
{# ... then convert the page's colocated_path attribute to a string so it can be concatenated... #}
{% set colocated_path = page.colocated_path | as_str %}
{# ... and use `resize_image` to get image's URL for colocated blog posts and non-colocated blog posts. #}
{% set image = resize_image(path=colocated_path ~ src, width=5000, height=5000, op="fit") %}
2023-05-11 06:21:49 +02:00
{% endif %}
2024-02-06 19:31:27 +01:00
< img src = "{{ src | safe }}" { % if alt % } alt = "{{ alt }}" { % endif % } class = "{% if position %}{{ position }}{% else -%} center {%- endif %}" { % - if style % } style = "{{ style | safe }}" { % - endif % } decoding = "async" loading = "lazy" / >
2019-02-05 19:27:02 +01:00
{% endif %}