diff options
Diffstat (limited to 'templates/shortcodes/imgswap.html')
| -rw-r--r-- | templates/shortcodes/imgswap.html | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/templates/shortcodes/imgswap.html b/templates/shortcodes/imgswap.html index 80a3b74..a6f7b83 100644 --- a/templates/shortcodes/imgswap.html +++ b/templates/shortcodes/imgswap.html @@ -45,7 +45,9 @@ {%- if not alt %} {%- set alt = img | split(pat=".") | first %} {%- endif %} - <img src="{{ path | safe }}{{ img | safe }}" class="img-main{% if class %} {{class}}{% endif %}"{% if alt %} alt="{{alt}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %} loading="lazy" /> + {%- if caption %}<figure class="fi{% if class %} {{class}}{% endif %}">{% endif -%} + {%- if link %}<a href="{{link | safe}}">{% endif %}<img src="{{ path | safe }}{{ img | safe }}" class="img-main{% if class %} {{class}}{% endif %}"{% if alt %} alt="{{alt}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %} loading="lazy" />{% if link %}</a>{% endif -%} + {%- if caption %}<figcaption>{{caption}}</figcaption></figure>{%- endif %} {%- set img = swap_src | split(pat="/") | last %} {%- set dirtest = swap_src | trim_start_matches(pat="./") %} @@ -92,5 +94,7 @@ {%- if not alt %} {%- set alt = img | split(pat=".") | first %} {%- endif %} - <img src="{{ path | safe }}{{ img | safe }}" class="img-swap{% if class %} {{class}}{% endif %}"{% if alt %} alt="{{alt}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %} loading="lazy" /> + {%- if caption %}<figure class="fi{% if class %} {{class}}{% endif %}">{% endif -%} + {%- if link %}<a href="{{link | safe}}">{% endif %}<img src="{{ path | safe }}{{ img | safe }}" class="img-swap{% if class %} {{class}}{% endif %}"{% if alt %} alt="{{alt}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %} loading="lazy" />{% if link %}</a>{% endif -%} + {%- if caption %}<figcaption>{{caption}}</figcaption></figure>{%- endif %} </div> |
