✨ feat(shortcodes): update image path retrieval and dimensions in shortcodes
- Use `get_url` function to generate correct image paths - Retrieve image dimensions with `get_image_metadata` function - Update shortcodes: dimmable_image, dual_theme_image, and invertible_image These changes reduce layout shifts.
This commit is contained in:
@@ -1 +1,2 @@
|
||||
<img class="dimmable-image" {% if src %}src={{ src | safe | replace(from="$BASE_URL", to=config.base_url) }} {% endif %} {% if alt %}alt="{{ alt }}"{% endif %}/>
|
||||
{% set meta = get_image_metadata(path=src) %}
|
||||
<img class="dimmable-image" src="{{ get_url(path=src) }}" {% if alt %}alt="{{ alt }}" {% endif %} {% if meta.width %}width="{{ meta.width }}" {% endif %} {% if meta.height %}height="{{ meta.height }}" {% endif %}/>
|
||||
|
Reference in New Issue
Block a user