about summary refs log tree commit diff
path: root/src/frontend/templates/mod.rs
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2021-12-05 22:55:32 +0300
committerVika <vika@fireburn.ru>2021-12-05 22:55:32 +0300
commitc0b552318cb08872c7deae82a10122b0e16b7ae8 (patch)
treeec372ac488be069c0897338ca15ea08b7abca683 /src/frontend/templates/mod.rs
parent24b109448bc8f1d30c88bbb9d01a05eec74b3d51 (diff)
downloadkittybox-c0b552318cb08872c7deae82a10122b0e16b7ae8.tar.zst
Added author mini-cards on h-entries
Diffstat (limited to 'src/frontend/templates/mod.rs')
-rw-r--r--src/frontend/templates/mod.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/frontend/templates/mod.rs b/src/frontend/templates/mod.rs
index a7c01e0..3585804 100644
--- a/src/frontend/templates/mod.rs
+++ b/src/frontend/templates/mod.rs
@@ -68,6 +68,17 @@ markup::define! {
                     h1."p-name" {
                         @post["properties"]["name"][0].as_str().unwrap()
                     }
+                } else {
+                    @if post["properties"]["author"][0].is_object() {
+                        section."mini-h-card" {
+                            a.larger[href=post["properties"]["author"][0]["properties"]["uid"][0].as_str().unwrap()] {
+                                @if post["properties"]["author"][0]["properties"]["photo"][0].is_string() {
+                                    img[src=post["properties"]["author"][0]["properties"]["photo"][0].as_str().unwrap()] {}
+                                }
+                                @post["properties"]["author"][0]["properties"]["name"][0].as_str().unwrap()
+                            }
+                        }
+                    }
                 }
                 div {
                     span {