mirror of
https://github.com/pawroman/zola-theme-terminimal.git
synced 2025-04-04 00:17:12 +02:00
Fix: Show images stored alongside *.md sections
This commit is contained in:
parent
07b99b9758
commit
733f1c17b9
|
@ -1,8 +1,10 @@
|
|||
{% if src %}
|
||||
{# If the image's URL is internal to the site... #}
|
||||
{% if src is not starting_with("http") %}
|
||||
{# ... then prepend the site's base URL to the image's URL. #}
|
||||
{% set src = config.base_url ~ src %}
|
||||
{# ... then convert the page's colocated_path ident to a string so it can be concatenated. #}
|
||||
{% set page_path = page.colocated_path | as_str %}
|
||||
{# ... and prepend the site's base URL to the image's URL. #}
|
||||
{% set src = config.base_url ~ page_path ~ src %}
|
||||
{% endif %}
|
||||
<img src="{{ src | safe }}"{% if alt %} alt="{{ alt }}"{% endif %} class="{% if position %}{{ position }}{% else -%} center {%- endif %}" {%- if style %} style="{{ style | safe }}" {%- endif %} />
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in a new issue