diff options
author | Wolfgang Müller | 2022-04-09 14:33:11 +0200 |
---|---|---|
committer | Wolfgang Müller | 2022-04-09 14:33:11 +0200 |
commit | ea7baaa91d90fed16a036678f238bb9be3f02f53 (patch) | |
tree | 20652cecea1a49512d1df7040bac57d9b751fd4a | |
parent | f97584618e2003a8e3e3ef17d8dfb9809725c453 (diff) | |
download | zunzuncito-ea7baaa91d90fed16a036678f238bb9be3f02f53.tar.gz |
templates: Allow setting 'float' for figures in the 'img' shortcode
We've never had to flow text around a <figure> 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.
-rw-r--r-- | templates/shortcodes/img.html | 4 |
1 files changed, 4 insertions, 0 deletions
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 -%} <figure> +{% else -%} +<figure style="float: {{ float }};"> +{% endif -%} <a href="/{{ url }}"> <img src="{{ image.url }}" alt="{{ alt }}" /> </a> |