refactor: Used askama_axum::Template

docs: https://djc.github.io/askama/integrations.html#axum-integration
This commit is contained in:
Simon C
2024-08-10 16:59:36 +02:00
parent 69a2d11501
commit c3f97564d6
6 changed files with 26 additions and 35 deletions

View File

@ -1,10 +1,9 @@
use askama::Template;
use askama_axum::IntoResponse;
use askama_axum::Template;
#[derive(Template)]
#[template(path = "pages/cps.html")]
struct CpsResponse;
pub struct CpsTemplate;
pub async fn cps() -> impl IntoResponse {
CpsResponse.into_response()
pub async fn cps() -> CpsTemplate {
CpsTemplate
}

View File

@ -1,10 +1,9 @@
use askama::Template;
use askama_axum::IntoResponse;
use askama_axum::Template;
#[derive(Template)]
#[template(path = "pages/home.html")]
struct HomeResponse;
pub struct HomeTemplate;
pub async fn home() -> impl IntoResponse {
HomeResponse.into_response()
pub async fn home() -> HomeTemplate {
HomeTemplate
}