summaryrefslogtreecommitdiffstatshomepage
path: root/templates/shortcodes/img.html
diff options
context:
space:
mode:
authorWolfgang Müller2022-04-09 14:36:00 +0200
committerWolfgang Müller2022-04-09 14:36:00 +0200
commit01285fe6b24c1a012025067bd09a2af54fccda2b (patch)
treea97193ebf0e3fa4dde7397eceb83b92fe83ff842 /templates/shortcodes/img.html
parentea7baaa91d90fed16a036678f238bb9be3f02f53 (diff)
downloadzunzuncito-01285fe6b24c1a012025067bd09a2af54fccda2b.tar.gz
templates: Allow setting custom links in the 'img' shortcode
Up until now we always linked to the image itself, but in the future we may want to link to any arbitrary (even external) page. Add a 'link' argument to the 'img' shortcode to facilitate this. If no link is given, we fall back to linking to the image; this makes sure that older posts need not be changed.
Diffstat (limited to 'templates/shortcodes/img.html')
-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 1b960c4..320ac84 100644
--- a/templates/shortcodes/img.html
+++ b/templates/shortcodes/img.html
@@ -5,7 +5,7 @@
{% else -%}
<figure style="float: {{ float }};">
{% endif -%}
- <a href="/{{ url }}">
+ <a href="{% if link %}{{ link }}{% else %}/{{ url }}{% endif %}">
<img src="{{ image.url }}" alt="{{ alt }}" />
</a>
{% if caption -%}