summaryrefslogtreecommitdiffstats
path: root/lib/partials/picture.p
diff options
context:
space:
mode:
authormaike <maike@synzr.tw>2026-09-03 10:59:09 +0500
committermaike <maike@synzr.tw>2026-09-03 10:59:09 +0500
commitb5dcc96742cc2cbf98e4c0f734e842418e4f4307 (patch)
treeb45c6a5498a2c0c974cbb216ea5d0d7186e33f97 /lib/partials/picture.p
parente176c0f0709bd17a46d943b96e631a3f2b1320fb (diff)
downloadhamster-b5dcc96742cc2cbf98e4c0f734e842418e4f4307.tar.gz
hamster-b5dcc96742cc2cbf98e4c0f734e842418e4f4307.tar.bz2
hamster-b5dcc96742cc2cbf98e4c0f734e842418e4f4307.zip
Restructued a project
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[]