Skip to content

Commit

Permalink
Item URL should point to post URL (#3345)
Browse files Browse the repository at this point in the history
If the post is an URL post the item link should point to the URL of the
link that is being posted.
  • Loading branch information
simmel committed Jun 26, 2023
1 parent 62c8ac1 commit c9e9ff4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/routes/src/feeds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ fn create_post_items(
i.pub_date(dt.to_rfc2822());

let post_url = format!("{}/post/{}", protocol_and_hostname, p.post.id);
i.link(post_url.clone());
i.comments(post_url.clone());
let guid = GuidBuilder::default()
.permalink(true)
Expand All @@ -499,6 +498,9 @@ fn create_post_items(
if let Some(url) = p.post.url {
let link_html = format!("<br><a href=\"{url}\">{url}</a>");
description.push_str(&link_html);
i.link(url.to_string());
} else {
i.link(post_url.clone());
}

if let Some(body) = p.post.body {
Expand Down

0 comments on commit c9e9ff4

Please sign in to comment.