diff --git a/templates/shortcodes/figure.html b/templates/shortcodes/figure.html index d841b5c..f375b16 100644 --- a/templates/shortcodes/figure.html +++ b/templates/shortcodes/figure.html @@ -1,8 +1,15 @@ {% if src %} -
- - {% if caption %} -
{{ caption | markdown() | safe }}
- {% endif %} -
+ {# 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 = get_url(path=page.colocated_path ~ src) %} + {% endif %} +
+ + {% if caption %} +
{{ caption | markdown() | safe }}
+ {% endif %} +
{% endif %} diff --git a/templates/shortcodes/image.html b/templates/shortcodes/image.html index 7a2f044..2d69182 100644 --- a/templates/shortcodes/image.html +++ b/templates/shortcodes/image.html @@ -2,7 +2,7 @@ {# 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 %} + {% set src = get_url(path=page.colocated_path ~ src) %} {% endif %} - + {% endif %}