Skip to content

Commit

Permalink
fix(server): added missing atom feed entry fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Taylan Gökkaya committed Mar 22, 2022
1 parent e913bd5 commit 4deb9fe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "blog"
version = "0.18.2"
version = "0.18.3"
edition = "2021"

[[bin]]
Expand Down
15 changes: 14 additions & 1 deletion server/src/feed.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use atom_syndication::{
CategoryBuilder,
PersonBuilder,
ContentBuilder,
EntryBuilder,
FeedBuilder,
LinkBuilder,
PersonBuilder,
};

use crate::{
Expand Down Expand Up @@ -52,6 +53,14 @@ async fn gen_feed() -> anyhow::Result<String> {
url_title = &a.url_title
))
.summary(Some(a.about.as_str().into()))
.content(
ContentBuilder::default()
.src(format!(
"{home}/articles/{url_title}",
url_title = &a.url_title
))
.build(),
)
.author(PersonBuilder::default().name(author).build())
.build()
})
Expand All @@ -61,6 +70,10 @@ async fn gen_feed() -> anyhow::Result<String> {
.title(x.title.clone().unwrap_or_else(|| String::from("Untitled")))
.summary(x.comment.as_deref().map(|s| s.into()))
.id(format!("{home}/music/{id}", id = x.id))
.content(ContentBuilder::default()
.src(format!("{home}/music/{id}", id = x.id))
.build()
)
// .link(Some(format!("{home}/music/{id}", id = x.id)))
.published(Some(x.date.to_utc().into()))
.updated(x.date.to_utc())
Expand Down

0 comments on commit 4deb9fe

Please sign in to comment.