page rewrite
Some checks failed
CI / Check typos (push) Successful in 1m3s
CI / Check links (push) Failing after 1m14s
CI / Clippy (push) Successful in 1m43s
CI / Build and test (push) Successful in 1m31s
CI / Build container (push) Successful in 1m45s
CI / Deploy on waypoint (push) Failing after 1m23s

This commit is contained in:
2025-11-16 12:58:20 -08:00
parent 04d98462dd
commit b6de727883
23 changed files with 1463 additions and 730 deletions

View File

@@ -1,34 +1,29 @@
use maud::html;
use page::page::{Page, PageMetadata};
use page::servable::{Page, PageMetadata};
use reqwest::StatusCode;
use crate::pages::page_wrapper;
use crate::pages::MAIN_TEMPLATE;
pub fn notfound() -> Page {
Page {
meta: PageMetadata {
title: "Betalupi: About".into(),
author: None,
MAIN_TEMPLATE.derive(
PageMetadata {
title: "Page not found".into(),
author:None,
description: None,
image: Some("/assets/img/icon.png".to_owned()),
backlinks: Some(false),
},
response_code: StatusCode::NOT_FOUND,
generate_html: Box::new(move |page, _ctx| {
move |_page, _ctx| {
Box::pin(async {
let inner = html! {
div style="display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh" {
p style="font-weight:bold;font-size:50pt;margin:0;" { "404" }
p style="font-size:13pt;margin:0;color:var(--grey);" { "(page not found)" }
a style="font-size:12pt;margin:10pt;padding:5px;" href="/" {"<- Back to site"}
html! {
div class="wrapper" {
div style="display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh" {
p style="font-weight:bold;font-size:50pt;margin:0;" { "404" }
p style="font-size:13pt;margin:0;color:var(--grey);" { "(page not found)" }
a style="font-size:12pt;margin:10pt;padding:5px;" href="/" {"<- Back to site"}
}
}
};
page_wrapper(&page.meta, inner, false).await
}
})
}),
..Default::default()
}
},
).response_code(StatusCode::NOT_FOUND)
}