diff options
Diffstat (limited to 'kittybox-rs/templates/src/mf2.rs')
-rw-r--r-- | kittybox-rs/templates/src/mf2.rs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/kittybox-rs/templates/src/mf2.rs b/kittybox-rs/templates/src/mf2.rs index 893cf7b..0e03dc6 100644 --- a/kittybox-rs/templates/src/mf2.rs +++ b/kittybox-rs/templates/src/mf2.rs @@ -178,6 +178,17 @@ markup::define! { } } } + @if let Some(links) = post["properties"]["syndication"].as_array() { + @if !links.is_empty() { + hr; + ul { + "Also published on:" + @for url in links.iter().filter_map(|i| i.as_str()) { + li { a."u-syndication"[href=url] { @url } } + } + } + } + } @if post["properties"]["location"].is_array() || post["properties"]["checkin"].is_array() { div { @if post["properties"]["checkin"].is_array() { @@ -307,7 +318,14 @@ markup::define! { @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()).filter(|v| !v.starts_with(&card["properties"]["author"][0].as_str().unwrap())) { + @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()) + .filter(|v| !v.starts_with(card["properties"]["author"][0].as_str().unwrap())) + { li { a."u-url"[href=url, rel="me"] { @url } } } } |