feat(shortcodes): add inline option to image shortcodes (#315)

This commit is contained in:
Óscar
2024-05-18 14:52:39 +02:00
committed by GitHub
parent 6a4f4244e0
commit 27525fc13f
10 changed files with 101 additions and 39 deletions

View File

@@ -16,11 +16,17 @@
{%- endif -%}
{%- set lazy_loading = lazy_loading | default(value=true) -%}
{%- set inline = inline | default(value=false) -%}
{%- set class_list = "invertible-image" -%}
{%- if inline -%}
{%- set class_list = class_list ~ " inline" -%}
{%- endif -%}
{%- if full_width -%}
<div class="full-width">
{%- endif -%}
<img class="invertible-image" src="{{ image_url }}"{% if lazy_loading %} loading="lazy"{% endif %}{% if alt %} alt="{{ alt }}"{% endif %}{% if meta.width %} width="{{ meta.width }}"{% endif %}{% if meta.height %} height="{{ meta.height }}" {% endif %}/>
<img class="{{ class_list }}" src="{{ image_url }}"{% if lazy_loading %} loading="lazy"{% endif %}{% if alt %} alt="{{ alt }}"{% endif %}{% if meta.width %} width="{{ meta.width }}"{% endif %}{% if meta.height %} height="{{ meta.height }}" {% endif %}/>
{%- if full_width -%}
</div>
{%- endif -%}