Item URL should point to post URL (#3345)

If the post is an URL post the item link should point to the URL of the
link that is being posted.
This commit is contained in:
Simon Lundström 2023-06-26 15:11:16 +02:00 committed by GitHub
parent 62c8ac1db5
commit c9e9ff46fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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