mirror of
https://github.com/pawroman/zola-theme-terminimal.git
synced 2025-01-08 19:51:06 +01:00
Compare commits
2 commits
83136814db
...
88da0fef3f
Author | SHA1 | Date | |
---|---|---|---|
88da0fef3f | |||
4f3e58d1c2 |
|
@ -1,8 +1,10 @@
|
||||||
{% if src %}
|
{% if src %}
|
||||||
{# If the image's URL is internal to the site... #}
|
{# If the image's URL is internal to the site... #}
|
||||||
{% if src is not starting_with("http") %}
|
{% if src is not starting_with("http") %}
|
||||||
{# ... then prepend the site's base URL to the image's URL. #}
|
{# ... then convert the page's colocated_path attribute to a string so it can be concatenated... #}
|
||||||
{% set src = config.base_url ~ src %}
|
{% 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") %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<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"/>
|
<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"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue