so many changes
Some checks failed
test / cargo test (push) Failing after 1m2s

This commit is contained in:
2024-10-03 14:59:28 +02:00
parent 2979e21285
commit ceb3f4b89d
19 changed files with 124 additions and 66 deletions

25
src/pages/not_found.rs Normal file
View File

@ -0,0 +1,25 @@
use askama::Template;
use axum::{extract::OriginalUri, http::StatusCode};
use tracing::info;
use crate::components::site_header::HeaderProps;
#[derive(Template)]
#[template(path = "not_found.html")]
pub struct NotFoundPage {
title: String,
header_props: HeaderProps,
}
pub async fn render_not_found(
OriginalUri(original_uri): OriginalUri,
) -> Result<(StatusCode, NotFoundPage), StatusCode> {
info!("{original_uri} not found");
Ok((
StatusCode::NOT_FOUND,
NotFoundPage {
title: "This page does not exists".to_owned(),
header_props: HeaderProps::default(),
},
))
}