add description for rss item (just like https://news.ycombinator.com/… (#220)

fix #201
This commit is contained in:
freedit-dev 2024-09-21 12:05:32 +08:00 committed by GitHub
parent 2991813c2d
commit 69c7a69afd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -494,6 +494,11 @@ pub async fn rss(req: Request<Body>) -> Result<Response<Body>, String> {
link: Some(utils::get_post_url(&post)), link: Some(utils::get_post_url(&post)),
author: Some(post.author.name), author: Some(post.author.name),
content: Some(rewrite_urls(&post.body)), content: Some(rewrite_urls(&post.body)),
description: Some(format!(
"<a href='{}{}'>Comments</a>",
config::get_setting("REDLIB_FULL_URL").unwrap_or_default(),
post.permalink
)),
..Default::default() ..Default::default()
}) })
.collect::<Vec<_>>(), .collect::<Vec<_>>(),