From c0b552318cb08872c7deae82a10122b0e16b7ae8 Mon Sep 17 00:00:00 2001 From: Vika Date: Sun, 5 Dec 2021 22:55:32 +0300 Subject: Added author mini-cards on h-entries --- src/frontend/templates/mod.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/frontend/templates/mod.rs') 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 { -- cgit 1.4.1