about summary refs log tree commit diff
path: root/kittybox-rs
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2023-06-15 20:21:46 +0300
committerVika <vika@fireburn.ru>2023-06-15 20:21:46 +0300
commit9a28da3ac18f60329474e6b48a77f07e57ba88d4 (patch)
treed7702e57dcdc84e4e7958cd54b890970485f783a /kittybox-rs
parent7264126a184b357a1764a577c299d1cc06083696 (diff)
downloadkittybox-9a28da3ac18f60329474e6b48a77f07e57ba88d4.tar.zst
fixup! templates: allow for alt-text on profile photo
Diffstat (limited to 'kittybox-rs')
-rw-r--r--kittybox-rs/templates/src/indieauth.rs8
1 files changed, 7 insertions, 1 deletions
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")
                     }