summaryrefslogtreecommitdiffstatshomepage
path: root/templates/shortcodes/img.html
diff options
context:
space:
mode:
authorWolfgang Müller2021-06-12 14:21:59 +0200
committerWolfgang Müller2021-06-12 14:21:59 +0200
commitad2be2b20c337d99ebe6e7d4b8cf6106cfba77df (patch)
tree65c0ddbb7828fd5b174eb531739097f83a3f17ee /templates/shortcodes/img.html
downloadzunzuncito-ad2be2b20c337d99ebe6e7d4b8cf6106cfba77df.tar.gz
Initial commit
Diffstat (limited to 'templates/shortcodes/img.html')
-rw-r--r--templates/shortcodes/img.html9
1 files changed, 9 insertions, 0 deletions
diff --git a/templates/shortcodes/img.html b/templates/shortcodes/img.html
new file mode 100644
index 0000000..13d38d6
--- /dev/null
+++ b/templates/shortcodes/img.html
@@ -0,0 +1,9 @@
+{% set url = page.path ~ path | trim_start_matches(pat="/") -%}
+<figure>
+ <a href="/{{ url }}">
+ <img src="{{ resize_image(path=url, width=500, op="fit_width") }}" alt="{{ alt }}" />
+ </a>
+ {% if caption -%}
+ <figcaption class="smaller">{{ caption }}</figcaption>
+ {% endif -%}
+</figure>