summaryrefslogtreecommitdiffstats
path: root/lib/partials/picture.p
diff options
context:
space:
mode:
Diffstat (limited to 'lib/partials/picture.p')
-rw-r--r--lib/partials/picture.p14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/partials/picture.p b/lib/partials/picture.p
new file mode 100644
index 0000000..cdd1baf
--- /dev/null
+++ b/lib/partials/picture.p
@@ -0,0 +1,14 @@
+@picture[images;default_type;.alt;.class;.role;.height]
+<picture>
+ ^images.foreach[type;srcset]{
+ <source srcset="$srcset" type="$type">
+ }
+ <img
+ src="$images.[$default_type]"
+ ^if(def $alt){alt="$alt"}
+ ^if(def $class){class="$class"}
+ ^if(def $role){role="$role"}
+ ^if(def $height){height="$height"}
+ >
+</picture>
+#end @picture[]