showcase projects loading and displaying

This commit is contained in:
2024-07-21 22:42:54 +02:00
parent 65bb29f36b
commit 1861a85e76
18 changed files with 215 additions and 48 deletions

View File

@ -1,6 +1,10 @@
use askama::Template;
use crate::{pages::post::PostMetadata, post_list::get_post_list, post_parser::ParseResult};
use crate::{
pages::post::{PostMetadata, BLOG_POST_PATH},
post_list::get_post_list,
post_parser::ParseResult,
};
#[derive(Template)]
#[template(path = "site_footer.html")]
@ -9,7 +13,9 @@ pub struct SiteFooter {
}
pub async fn render_site_footer() -> SiteFooter {
let mut post_list = get_post_list::<PostMetadata>().await.unwrap_or(vec![]);
let mut post_list = get_post_list::<PostMetadata>(BLOG_POST_PATH)
.await
.unwrap_or(vec![]);
post_list.sort_by_key(|post| post.metadata.date);
post_list.reverse();