From 32023fc003618ef0500d0c94217435089cfd1b81 Mon Sep 17 00:00:00 2001 From: Vika Shleina Date: Mon, 19 Jul 2021 08:19:43 +0300 Subject: Added URL display to h-cards --- src/frontend/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/frontend') diff --git a/src/frontend/mod.rs b/src/frontend/mod.rs index b37dfea..28c4c15 100644 --- a/src/frontend/mod.rs +++ b/src/frontend/mod.rs @@ -42,6 +42,12 @@ mod templates { link[rel="micropub", href="/micropub"]; // Static, because it's built into the server itself link[rel="authorization_endpoint", href=&endpoints.authorization_endpoint]; link[rel="token_endpoint", href=&endpoints.token_endpoint]; + @if endpoints.webmention.is_some() { + link[rel="webmention", href=&endpoints.webmention.as_ref()]; + } + @if endpoints.microsub.is_some() { + link[rel="microsub", href=&endpoints.microsub.as_ref()]; + } } body { nav#headerbar { @@ -466,6 +472,14 @@ mod templates { p."p-note" { @card["properties"]["note"][0]["value"].as_str().unwrap_or_else(|| card["properties"]["note"][0].as_str().unwrap()) } + @if card["properties"]["url"].is_array() { + ul { + "Can be found elsewhere at:" + @for url in card["properties"]["url"].as_array().unwrap().iter().filter_map(|v| v.as_str()).filter(|v| v != &card["properties"]["uid"][0].as_str().unwrap()) { + li { a."u-url"[href=url, rel="me"] { @url } } + } + } + } } } Food<'a>(food: &'a serde_json::Value) { -- cgit 1.4.1