mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-25 15:39:11 +00:00
Change RSS feeds to use lemmy URL for the rss link. Fixes #1378
This commit is contained in:
parent
1af906c224
commit
37ad9e9a09
|
@ -376,6 +376,7 @@ fn create_post_items(posts: Vec<PostView>) -> Result<Vec<Item>, LemmyError> {
|
|||
Settings::get().get_protocol_and_hostname(),
|
||||
p.post.id
|
||||
);
|
||||
i.link(post_url.to_owned());
|
||||
i.comments(post_url.to_owned());
|
||||
let guid = GuidBuilder::default()
|
||||
.permalink(true)
|
||||
|
@ -393,10 +394,6 @@ fn create_post_items(posts: Vec<PostView>) -> Result<Vec<Item>, LemmyError> {
|
|||
// TODO: for category we should just put the name of the category, but then we would have
|
||||
// to read each community from the db
|
||||
|
||||
if let Some(url) = p.post.url {
|
||||
i.link(url);
|
||||
}
|
||||
|
||||
// TODO add images
|
||||
let mut description = format!("submitted by <a href=\"{}\">{}</a> to <a href=\"{}\">{}</a><br>{} points | <a href=\"{}\">{} comments</a>",
|
||||
p.creator.actor_id,
|
||||
|
@ -407,6 +404,12 @@ fn create_post_items(posts: Vec<PostView>) -> Result<Vec<Item>, LemmyError> {
|
|||
post_url,
|
||||
p.counts.comments);
|
||||
|
||||
// If its a url post, add it to the description
|
||||
if let Some(url) = p.post.url {
|
||||
let link_html = format!("<br><a href=\"{url}\">{url}</a>", url = url);
|
||||
description.push_str(&link_html);
|
||||
}
|
||||
|
||||
if let Some(body) = p.post.body {
|
||||
let html = markdown_to_html(&body);
|
||||
description.push_str(&html);
|
||||
|
|
Loading…
Reference in a new issue