diff options
author | Vika <vika@fireburn.ru> | 2021-12-07 16:53:29 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2021-12-07 16:53:29 +0300 |
commit | 2727e8bdd0122e367a6b155f96829fec26e536f9 (patch) | |
tree | 22964e24b57332edb525125374b73d36f785afc8 /src/frontend/templates/mod.rs | |
parent | 080b925ce13242d69bf0af9e7ca5300173b94785 (diff) | |
download | kittybox-2727e8bdd0122e367a6b155f96829fec26e536f9.tar.zst |
Display pretty links in case there is more than one URL in a post
Diffstat (limited to 'src/frontend/templates/mod.rs')
-rw-r--r-- | src/frontend/templates/mod.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/frontend/templates/mod.rs b/src/frontend/templates/mod.rs index bf30fa1..c21d30b 100644 --- a/src/frontend/templates/mod.rs +++ b/src/frontend/templates/mod.rs @@ -127,6 +127,17 @@ markup::define! { } } } + @if post["properties"]["url"].as_array().unwrap().len() > 1 { + hr; + ul { + "Pretty permalinks for this post:" + @for url in post["properties"]["url"].as_array().unwrap().iter().filter(|i| **i != post["properties"]["uid"][0]).map(|i| i.as_str().unwrap()) { + li { + a."u-url"[href=url] { @url } + } + } + } + } @if post["properties"]["location"].is_array() || post["properties"]["checkin"].is_array() { div { @if post["properties"]["checkin"].is_array() { |