Merge pull request #37 from goingforbrooke/patch-2

Fix: shortcode images don't load after build
This commit is contained in:
Paweł Romanowski 2023-05-16 12:03:40 +02:00 committed by GitHub
commit 9f79a41208
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,3 +1,8 @@
{% 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 %}
{% endif %}
<img src="{{ src | safe }}"{% if alt %} alt="{{ alt }}"{% endif %} class="{% if position %}{{ position }}{% else -%} center {%- endif %}" {%- if style %} style="{{ style | safe }}" {%- endif %} />
{% endif %}