diff options
| author | Jieiku | 2024-08-24 11:21:26 -0700 |
|---|---|---|
| committer | Jieiku | 2024-08-24 11:21:26 -0700 |
| commit | 559e2c1cc05f31d6cf52231ecabd94be2d0f1daa (patch) | |
| tree | 9d0f9f051bd5b971bc5b88025c3954e775dff8fc /templates/shortcodes | |
| parent | 9e052f0a552497be4265ab2ca3a977f6cc15b224 (diff) | |
| download | abridge-559e2c1cc05f31d6cf52231ecabd94be2d0f1daa.tar.gz abridge-559e2c1cc05f31d6cf52231ecabd94be2d0f1daa.tar.bz2 abridge-559e2c1cc05f31d6cf52231ecabd94be2d0f1daa.zip | |
Add Caption and Links to img/imgswap
Diffstat (limited to 'templates/shortcodes')
| -rw-r--r-- | templates/shortcodes/img.html | 4 | ||||
| -rw-r--r-- | templates/shortcodes/imgswap.html | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/templates/shortcodes/img.html b/templates/shortcodes/img.html index ac3ba6b..108b16c 100644 --- a/templates/shortcodes/img.html +++ b/templates/shortcodes/img.html @@ -44,4 +44,6 @@ {%- if not alt %} {%- set alt = img | split(pat=".") | first %} {%- endif %} -<img src="{{ path | safe }}{{ img | safe }}"{% if class %} 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 }}"{% if class %} 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 %} 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> |
