feat: add full-width image option to shortcodes

Closes #85
This commit is contained in:
welpo
2023-07-05 02:43:07 +02:00
parent 8c5f30556a
commit fd50204e32
9 changed files with 89 additions and 4 deletions

View File

@@ -1,4 +1,10 @@
{% set light_meta = get_image_metadata(path=light_src, allow_missing=true) %}
{% set dark_meta = get_image_metadata(path=dark_src, allow_missing=true) %}
{% if full_width | default(value=false) %}
<div class="full-width">
{% endif %}
<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">
{% if full_width | default(value=false) %}
</div>
{% endif %}