migrate axum and askama
test / cargo test (push) Failing after 1m10s

This commit is contained in:
2025-06-16 21:15:53 +02:00
parent 5ba193cd56
commit 6a5a9c890f
19 changed files with 194 additions and 112 deletions
+17 -11
View File
@@ -1,6 +1,8 @@
use askama::Template;
use axum::{
extract::{OriginalUri, Path},
http::StatusCode,
response::{Html, IntoResponse},
};
use tokio::try_join;
use tracing::debug;
@@ -22,7 +24,7 @@ use super::post_list::PostListTemplate;
pub async fn render_blog_post_list(
tag: Option<Path<String>>,
OriginalUri(original_uri): OriginalUri,
) -> Result<PostListTemplate, StatusCode> {
) -> Result<impl IntoResponse, StatusCode> {
// I will forget what happens here in a week. But essentially it's pattern matching and shadowing
let tag = tag.map(|Path(tag)| tag);
@@ -50,14 +52,18 @@ pub async fn render_blog_post_list(
("Blog posts".to_string(), "Blog posts".to_string())
};
Ok(PostListTemplate {
title,
og_title,
segment: Segment::Blog,
posts,
header_props,
tags: blog_tags,
featured_projects,
current_url: original_uri.to_string(),
})
Ok(Html(
PostListTemplate {
title,
og_title,
segment: Segment::Blog,
posts,
header_props,
tags: blog_tags,
featured_projects,
current_url: original_uri.to_string(),
}
.render()
.unwrap(),
))
}