From ea7baaa91d90fed16a036678f238bb9be3f02f53 Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Sat, 9 Apr 2022 14:33:11 +0200 Subject: templates: Allow setting 'float' for figures in the 'img' shortcode We've never had to flow text around a
element before, so this particular feature was missing. Instead of creating small CSS rules, interface with the style attribute directly. This is easier and allows more straight-forward control. --- templates/shortcodes/img.html | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'templates') diff --git a/templates/shortcodes/img.html b/templates/shortcodes/img.html index ff6869d..1b960c4 100644 --- a/templates/shortcodes/img.html +++ b/templates/shortcodes/img.html @@ -1,6 +1,10 @@ {% set url = page.path ~ path | trim_start_matches(pat="/") -%} {% set image = resize_image(path=url, width=width | default(value=500), op="fit_width", format=format | default(value="jpg")) -%} +{% if not float -%}
+{% else -%} +
+{% endif -%} {{ alt }} -- cgit v1.2.3-2-gb3c3