summaryrefslogtreecommitdiffstatshomepage
path: root/templates
diff options
context:
space:
mode:
authorWolfgang Müller2022-02-06 21:57:12 +0100
committerWolfgang Müller2022-02-06 21:57:12 +0100
commitfe8b9a8cbe2be67c9995c466130e240725b63f64 (patch)
treedc34a7e32781a121c8bcf920fd1809ed20e139cb /templates
parent0cafe2653998a2ed5fe6fb483b543c1b71e53516 (diff)
downloadzunzuncito-fe8b9a8cbe2be67c9995c466130e240725b63f64.tar.gz
Update image template functions for zola 0.14.0
The 'resize_image' function was changed to return a map in [1], so we have to update our code accordingly. [1] https://github.com/getzola/zola/commit/7fb99eaa44f387fadf744354c605f0cfcc582800
Diffstat (limited to 'templates')
-rw-r--r--templates/shortcodes/img.html3
1 files changed, 2 insertions, 1 deletions
diff --git a/templates/shortcodes/img.html b/templates/shortcodes/img.html
index b339382..84d549e 100644
--- a/templates/shortcodes/img.html
+++ b/templates/shortcodes/img.html
@@ -1,7 +1,8 @@
{% set url = page.path ~ path | trim_start_matches(pat="/") -%}
+{% set image = resize_image(path=url, width=500, op="fit_width", format=format | default(value="jpg")) -%}
<figure>
<a href="/{{ url }}">
- <img src="{{ resize_image(path=url, width=500, op="fit_width", format=format | default(value="jpg")) }}" alt="{{ alt }}" />
+ <img src="{{ image.url }}" alt="{{ alt }}" />
</a>
{% if caption -%}
<figcaption class="smaller">{{ caption | markdown(inline=true) | safe }}</figcaption>