aboutsummaryrefslogtreecommitdiff
path: root/templates/shortcodes/image.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/shortcodes/image.html')
-rw-r--r--templates/shortcodes/image.html7
1 files changed, 7 insertions, 0 deletions
diff --git a/templates/shortcodes/image.html b/templates/shortcodes/image.html
new file mode 100644
index 0000000..ea236ef
--- /dev/null
+++ b/templates/shortcodes/image.html
@@ -0,0 +1,7 @@
+<picture>
+ {% for source in sources -%}
+ {% set type = source | split(pat=".") | last -%}
+ <source srcset="{{ config.base_url | safe}}{{ page.path | safe }}{{ source | safe }}" type="{{ 'img/' ~ type }}">
+ {% endfor -%}
+ <img src="{{ fallback_path }}" alt="{{ fallback_alt }}"/>
+</picture>