Skip to content

Commit

Permalink
Merge pull request #37 from goingforbrooke/patch-2
Browse files Browse the repository at this point in the history
Fix: shortcode images don't load after build
  • Loading branch information
pawroman authored May 16, 2023
2 parents eae2296 + f802666 commit 9f79a41
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions templates/shortcodes/image.html
Original file line number Diff line number Diff line change
@@ -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 %}

0 comments on commit 9f79a41

Please sign in to comment.