aboutsummaryrefslogtreecommitdiff
path: root/src/tmpl
diff options
context:
space:
mode:
authorXe <me@christine.website>2022-07-24 17:32:34 +0000
committerXe <me@christine.website>2022-07-24 17:32:34 +0000
commite9733ce6844894f4f1f30948611a57a02c6766ec (patch)
tree7206f0b26f610e8018ffe345b093023c9f475702 /src/tmpl
parent57b2b0a5e321c758be687393ff94e5f429b1fc9e (diff)
downloadxesite-e9733ce6844894f4f1f30948611a57a02c6766ec.tar.xz
xesite-e9733ce6844894f4f1f30948611a57a02c6766ec.zip
add xeblog-sticker element
Signed-off-by: Xe <me@christine.website>
Diffstat (limited to 'src/tmpl')
-rw-r--r--src/tmpl/mod.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tmpl/mod.rs b/src/tmpl/mod.rs
index 5391e9f..08ab090 100644
--- a/src/tmpl/mod.rs
+++ b/src/tmpl/mod.rs
@@ -56,3 +56,15 @@ pub fn xeblog_conv(name: String, mood: String, body: Markup) -> Markup {
}
}
}
+
+pub fn xeblog_sticker(name: String, mood: String) -> Markup {
+ html! {
+ center {
+ picture {
+ source type="image/avif" srcset={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".avif"};
+ source type="image/webp" srcset={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".webp"};
+ img alt={(name) " is " (mood)} src={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".png"};
+ }
+ }
+ }
+}