diff options
author | Vika Shleina <vika@fireburn.ru> | 2021-07-19 08:19:43 +0300 |
---|---|---|
committer | Vika Shleina <vika@fireburn.ru> | 2021-07-19 08:26:45 +0300 |
commit | 32023fc003618ef0500d0c94217435089cfd1b81 (patch) | |
tree | b5b6520d3f6afa3a5b9971419a045324b2a486d1 /src | |
parent | 64d45bd3ae244e10521db4693a52ffa3322bb410 (diff) | |
download | kittybox-32023fc003618ef0500d0c94217435089cfd1b81.tar.zst |
Added URL display to h-cards
Diffstat (limited to 'src')
-rw-r--r-- | src/frontend/mod.rs | 14 |
1 files changed, 14 insertions, 0 deletions
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) { |