aboutsummaryrefslogtreecommitdiff
path: root/src/post
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2023-04-02 15:01:32 -0400
committerXe Iaso <me@xeiaso.net>2023-04-02 15:01:32 -0400
commite8347815f7b1bfce0d5db600cdffc60ba1b3531a (patch)
treedb3d0d992a91219c7787b3d2bfb8204bbe9f2f2e /src/post
parent2cc14d7e10b29decf3ef1e88550ec603a78322e2 (diff)
downloadxesite-e8347815f7b1bfce0d5db600cdffc60ba1b3531a.tar.xz
xesite-e8347815f7b1bfce0d5db600cdffc60ba1b3531a.zip
linkpost over my backlog on the tailscale blog
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'src/post')
-rw-r--r--src/post/mod.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/post/mod.rs b/src/post/mod.rs
index be3bf04..2338365 100644
--- a/src/post/mod.rs
+++ b/src/post/mod.rs
@@ -46,7 +46,11 @@ impl Into<xe_jsonfeed::Item> for Post {
.title(self.front_matter.title.clone())
.content_html(self.body_html)
.id(format!("https://xeiaso.net/{}", self.link))
- .url(format!("https://xeiaso.net/{}", self.link))
+ .url(if let Some(url) = self.front_matter.redirect_to.as_ref() {
+ url.clone()
+ } else {
+ format!("https://xeiaso.net/{}", self.link)
+ })
.date_published(self.date.to_rfc3339())
.author(
xe_jsonfeed::Author::new()