aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@blos.sm>2024-01-31 21:23:51 +0000
committerLibravatar cel 🌸 <cel@blos.sm>2024-01-31 21:23:51 +0000
commit1b7418483e1e0692e5e015e5eef89687a107a402 (patch)
treeb55d09a95fdda7288c0767ad8fbd3c97d20c01c7 /src/main.rs
parent2426cd0f7a3aa7a181d4e9ba3447dd4471350af0 (diff)
downloadblossom-1b7418483e1e0692e5e015e5eef89687a107a402.tar.gz
blossom-1b7418483e1e0692e5e015e5eef89687a107a402.tar.bz2
blossom-1b7418483e1e0692e5e015e5eef89687a107a402.zip
add poems to main atom feed
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 5ee3b2a..1c5126a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -98,7 +98,19 @@ async fn get_blog(filter_tags: Option<Query<FilterTags>>) -> Result<templates::B
#[handler]
async fn feed() -> Result<Response> {
- let posts = Blogpost::get_articles().await?;
+ let blogposts: Vec<Box<dyn Post + Send + Sync>> = Blogpost::get_articles()
+ .await?
+ .into_iter()
+ .map(|bp| Box::new(bp) as Box<dyn Post + Send + Sync>)
+ .collect();
+ let poems: Vec<Box<dyn Post + Send + Sync>> = Poem::get_articles()
+ .await?
+ .into_iter()
+ .map(|poem| Box::new(poem) as Box<dyn Post + Send + Sync>)
+ .collect();
+ let mut posts = Vec::new();
+ posts.extend(blogposts);
+ posts.extend(poems);
// TODO: i18n
let context = atom::Context {
page_title: "celeste's hard drive".to_owned(),