From f97584618e2003a8e3e3ef17d8dfb9809725c453 Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Sat, 9 Apr 2022 14:14:18 +0200 Subject: 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. --- templates/shortcodes/img.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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")) -%}
{{ alt }} -- cgit v1.2.3-2-gb3c3