about summary refs log tree commit diff
path: root/templates/src
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2023-10-15 20:54:30 +0300
committerVika <vika@fireburn.ru>2023-10-15 20:54:30 +0300
commitdd74adb75960ceac8970f5a0b38f3d720733b63f (patch)
treed3de1fa7c807413bf4c6be88496cf6d56452da43 /templates/src
parent27b5bcc274675eab956e70bc59ba3e137e5aa676 (diff)
downloadkittybox-dd74adb75960ceac8970f5a0b38f3d720733b63f.tar.zst
Fix bug with likes/bookmarks on h-entries lacking URLs in markup
Diffstat (limited to 'templates/src')
-rw-r--r--templates/src/mf2.rs22
1 files changed, 21 insertions, 1 deletions
diff --git a/templates/src/mf2.rs b/templates/src/mf2.rs
index 33cd84a..2c41de9 100644
--- a/templates/src/mf2.rs
+++ b/templates/src/mf2.rs
@@ -56,6 +56,13 @@ markup::define! {
                     " "
                     a."u-like-of"[href=likeof] { @likeof }
                 } else if let Some(likeof) = post["properties"]["like-of"][0].as_object() {
+                    " "
+                    span."like-icon"["aria-label"="liked"] {
+                        span."like-icon-label"["aria-hidden"="true"] {
+                            "❤️"
+                        }
+                    }
+                    " "
                     a."u-like-of"[href=likeof["properties"]["url"][0].as_str().unwrap()] {
                         @likeof["properties"]["name"][0]
                             .as_str()
@@ -63,9 +70,22 @@ markup::define! {
                     }
                 }
                 @if let Some(bookmarkof) = post["properties"]["bookmark-of"][0].as_str() {
-                    " 🔖 "
+                    " "
+                    span."like-icon"["aria-label"="bookmarked"] {
+                        span."bookmark-icon-label"["aria-hidden"="true"] {
+                            "🔖"
+                        }
+                    }
+                    " "
                     a."u-bookmark-of"[href=bookmarkof] { @bookmarkof }
                 } else if let Some(bookmarkof) = post["properties"]["bookmark-of"][0].as_object() {
+                    " "
+                    span."like-icon"["aria-label"="bookmarked"] {
+                        span."bookmark-icon-label"["aria-hidden"="true"] {
+                            "🔖"
+                        }
+                    }
+                    " "
                     a."u-bookmark-of"[href=bookmarkof["properties"]["url"][0].as_str().unwrap()] {
                         @bookmarkof["properties"]["name"][0]
                             .as_str()