summaryrefslogtreecommitdiffstatshomepage
path: root/templates/shortcodes/img.html
diff options
context:
space:
mode:
authorWolfgang Müller2021-07-03 13:30:48 +0200
committerWolfgang Müller2021-07-03 13:30:48 +0200
commitaa04d615cdd832d2300d427f4342ac09b93609d0 (patch)
tree2dfd2064e2aac912631f20d56024ac5eb762bd96 /templates/shortcodes/img.html
parent342bd393d64f3a852ccb0604fc802bc7b766051e (diff)
downloadzunzuncito-aa04d615cdd832d2300d427f4342ac09b93609d0.tar.gz
templates: Allow passing format to img shortcode
Sometimes we may want to override the default setting when processing images. Furthermore, since we will most likely want to generate JPG files in the general case in order to minimise the amount of data transferred when opening the front page, have the default in the shortcode be "jpg" instead of "auto".
Diffstat (limited to 'templates/shortcodes/img.html')
-rw-r--r--templates/shortcodes/img.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/shortcodes/img.html b/templates/shortcodes/img.html
index 13d38d6..6b4eca4 100644
--- a/templates/shortcodes/img.html
+++ b/templates/shortcodes/img.html
@@ -1,7 +1,7 @@
{% set url = page.path ~ path | trim_start_matches(pat="/") -%}
<figure>
<a href="/{{ url }}">
- <img src="{{ resize_image(path=url, width=500, op="fit_width") }}" alt="{{ alt }}" />
+ <img src="{{ resize_image(path=url, width=500, op="fit_width", format=format | default(value="jpg")) }}" alt="{{ alt }}" />
</a>
{% if caption -%}
<figcaption class="smaller">{{ caption }}</figcaption>