
- 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.
5 lines
586 B
HTML
5 lines
586 B
HTML
{% set light_meta = get_image_metadata(path=light_src) %}
|
|
{% set dark_meta = get_image_metadata(path=dark_src) %}
|
|
<img src="{{ get_url(path=light_src) }}" {% if alt %}alt="{{ alt }}" {% endif %} {% if light_meta.width %}width="{{ light_meta.width }}" {% endif %} {% if light_meta.height %}height="{{ light_meta.height }}" {% endif %} class="img-light">
|
|
<img src="{{ get_url(path=dark_src) }}" {% if alt %}alt="{{ alt }}" {% endif %} {% if dark_meta.width %}width="{{ dark_meta.width }}" {% endif %} {% if dark_meta.height %}height="{{ dark_meta.height }}" {% endif %} class="img-dark">
|