summaryrefslogtreecommitdiffstatshomepage
path: root/templates
diff options
context:
space:
mode:
authorWolfgang Müller2022-04-09 14:14:18 +0200
committerWolfgang Müller2022-04-09 14:14:18 +0200
commitf97584618e2003a8e3e3ef17d8dfb9809725c453 (patch)
tree71db6ec488cf091327dd9cfd7168931ec0b546d5 /templates
parent6bceb12869d4a9301c3dd1ba7aa7a30a16692729 (diff)
downloadzunzuncito-f97584618e2003a8e3e3ef17d8dfb9809725c453.tar.gz
templates: Allow specifying widths for images in the 'img' shortcode
An upcoming post will require a smaller figure which has text flowing around it. This is not nicely possible with the hard-coded setting of 500 pixels. Introduce an optional argument 'width' to the shortcode to make custom sizes possible.
Diffstat (limited to 'templates')
-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 84d549e..ff6869d 100644
--- a/templates/shortcodes/img.html
+++ b/templates/shortcodes/img.html
@@ -1,5 +1,5 @@
{% 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")) -%}
+{% set image = resize_image(path=url, width=width | default(value=500), op="fit_width", format=format | default(value="jpg")) -%}
<figure>
<a href="/{{ url }}">
<img src="{{ image.url }}" alt="{{ alt }}" />