summaryrefslogtreecommitdiffstats
path: root/partials/_picture.p
diff options
context:
space:
mode:
authormaike <maike@synzr.tw>2026-09-02 21:41:31 +0500
committermaike <maike@synzr.tw>2026-09-02 22:20:44 +0500
commite176c0f0709bd17a46d943b96e631a3f2b1320fb (patch)
tree422c5fec7cb4b1f90ec4d895b7f86329bcddb87e /partials/_picture.p
parente7c15e2602e49355444f5d90819dfd0ea66e47bf (diff)
downloadhamster-e176c0f0709bd17a46d943b96e631a3f2b1320fb.tar.gz
hamster-e176c0f0709bd17a46d943b96e631a3f2b1320fb.tar.bz2
hamster-e176c0f0709bd17a46d943b96e631a3f2b1320fb.zip
Clickable IRL photo
Diffstat (limited to 'partials/_picture.p')
-rw-r--r--partials/_picture.p10
1 files changed, 8 insertions, 2 deletions
diff --git a/partials/_picture.p b/partials/_picture.p
index 9128f1f..cdd1baf 100644
--- a/partials/_picture.p
+++ b/partials/_picture.p
@@ -1,8 +1,14 @@
-@picture[images;alt;class;default]
+@picture[images;default_type;.alt;.class;.role;.height]
<picture>
^images.foreach[type;srcset]{
<source srcset="$srcset" type="$type">
}
- <img src="$images.[$default]" alt="$alt" class="$class">
+ <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[]