The code and data behind xeiaso.net
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

add xeblog-sticker element

Signed-off-by: Xe <me@christine.website>

Xe e9733ce6 57b2b0a5

+21 -1
+9 -1
src/app/markdown.rs
··· 107 107 el.replace(&crate::tmpl::xeblog_salary_history(cfg.clone()).0, ContentType::Html); 108 108 109 109 Ok(()) 110 - }) 110 + }), 111 + element!("xeblog-sticker", |el| { 112 + let name = el.get_attribute("name").expect("wanted xeblog-sticker to contain name"); 113 + let name_lower = name.clone().to_lowercase(); 114 + let mood = el.get_attribute("mood").expect("wanted xeblog-sticker to contain mood"); 115 + el.replace(&crate::tmpl::xeblog_sticker(name, mood).0, ContentType::Html); 116 + 117 + Ok(()) 118 + }), 111 119 ], 112 120 ..RewriteStrSettings::default() 113 121 }).unwrap();
+12
src/tmpl/mod.rs
··· 56 56 } 57 57 } 58 58 } 59 + 60 + pub fn xeblog_sticker(name: String, mood: String) -> Markup { 61 + html! { 62 + center { 63 + picture { 64 + source type="image/avif" srcset={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".avif"}; 65 + source type="image/webp" srcset={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".webp"}; 66 + img alt={(name) " is " (mood)} src={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".png"}; 67 + } 68 + } 69 + } 70 + }