diff options
author | Wolfgang Müller | 2022-04-09 14:36:00 +0200 |
---|---|---|
committer | Wolfgang Müller | 2022-04-09 14:36:00 +0200 |
commit | 01285fe6b24c1a012025067bd09a2af54fccda2b (patch) | |
tree | a97193ebf0e3fa4dde7397eceb83b92fe83ff842 | |
parent | ea7baaa91d90fed16a036678f238bb9be3f02f53 (diff) | |
download | zunzuncito-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.
-rw-r--r-- | templates/shortcodes/img.html | 2 |
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 -%} |