summaryrefslogtreecommitdiffstatshomepage
path: root/templates/shortcodes/img.html
diff options
context:
space:
mode:
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>