From 9a28da3ac18f60329474e6b48a77f07e57ba88d4 Mon Sep 17 00:00:00 2001 From: Vika Date: Thu, 15 Jun 2023 20:21:46 +0300 Subject: fixup! templates: allow for alt-text on profile photo --- kittybox-rs/templates/src/indieauth.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'kittybox-rs/templates/src') diff --git a/kittybox-rs/templates/src/indieauth.rs b/kittybox-rs/templates/src/indieauth.rs index 908cd2c..6a46773 100644 --- a/kittybox-rs/templates/src/indieauth.rs +++ b/kittybox-rs/templates/src/indieauth.rs @@ -26,7 +26,13 @@ document.getElementById("indieauth_page").addEventListener("submit", submit_hand "Hi, " @if let Some(photo) = user["properties"]["photo"][0].as_str() { img.user_avatar[src=photo]; - } + } else if let Some(photo) = user["properties"]["photo"][0].as_object() { + img[ + src=photo["value"].as_str().unwrap(), + alt=photo["alt"].as_str().unwrap(), + loading="lazy" + ]; + } @user["properties"]["name"][0].as_str().unwrap_or("administrator") } -- cgit 1.4.1