404
Some checks failed
CI / Check links (push) Failing after 1m25s
CI / Check typos (push) Successful in 11s
CI / Clippy (push) Successful in 1m10s
CI / Build and test (push) Successful in 1m42s
CI / Build container (push) Successful in 1m5s
CI / Deploy on waypoint (push) Successful in 42s
Some checks failed
CI / Check links (push) Failing after 1m25s
CI / Check typos (push) Successful in 11s
CI / Clippy (push) Successful in 1m10s
CI / Build and test (push) Successful in 1m42s
CI / Build container (push) Successful in 1m5s
CI / Deploy on waypoint (push) Successful in 42s
This commit is contained in:
@@ -82,8 +82,10 @@ body {
|
||||
}
|
||||
|
||||
main {
|
||||
margin-top: 2ex;
|
||||
overflow-wrap: break-word;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
hr.footline {
|
||||
@@ -98,12 +100,6 @@ iframe {
|
||||
max-width: 90%;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.footContainer {
|
||||
padding-top: 0;
|
||||
|
||||
@@ -262,7 +262,7 @@ pub fn handouts() -> Page {
|
||||
br {}
|
||||
};
|
||||
|
||||
page_wrapper(&page.meta, inner).await
|
||||
page_wrapper(&page.meta, inner, true).await
|
||||
})
|
||||
}),
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ pub fn index() -> Page {
|
||||
meta: PageMetadata {
|
||||
title: "Betalupi: About".into(),
|
||||
author: Some("Mark".into()),
|
||||
description: Some("Description".into()),
|
||||
description: None,
|
||||
image: Some("/assets/img/icon.png".to_owned()),
|
||||
backlinks: Some(false),
|
||||
},
|
||||
@@ -74,7 +74,7 @@ pub fn index() -> Page {
|
||||
(Markdown(include_str!("index.md")))
|
||||
};
|
||||
|
||||
page_wrapper(&page.meta, inner).await
|
||||
page_wrapper(&page.meta, inner, true).await
|
||||
})
|
||||
}),
|
||||
|
||||
|
||||
@@ -10,9 +10,11 @@ use crate::components::{
|
||||
|
||||
mod handouts;
|
||||
mod index;
|
||||
mod notfound;
|
||||
|
||||
pub use handouts::handouts;
|
||||
pub use index::index;
|
||||
pub use notfound::notfound;
|
||||
|
||||
pub fn links() -> Page {
|
||||
/*
|
||||
@@ -80,7 +82,7 @@ fn page_from_markdown(md: impl Into<String>, default_image: Option<String>) -> P
|
||||
(html)
|
||||
};
|
||||
|
||||
page_wrapper(&page.meta, inner).await
|
||||
page_wrapper(&page.meta, inner, true).await
|
||||
})
|
||||
}),
|
||||
}
|
||||
@@ -93,6 +95,7 @@ fn page_from_markdown(md: impl Into<String>, default_image: Option<String>) -> P
|
||||
pub fn page_wrapper<'a>(
|
||||
meta: &'a PageMetadata,
|
||||
inner: Markup,
|
||||
footer: bool,
|
||||
) -> Pin<Box<dyn Future<Output = Markup> + 'a + Send + Sync>> {
|
||||
Box::pin(async move {
|
||||
html! {
|
||||
@@ -133,22 +136,30 @@ pub fn page_wrapper<'a>(
|
||||
}
|
||||
|
||||
body {
|
||||
div class="wrapper" {
|
||||
main { (inner) }
|
||||
main style=(
|
||||
// for 404 page. Margin makes it scroll.
|
||||
match footer {
|
||||
true => "margin-top:3ex;",
|
||||
false =>""
|
||||
}
|
||||
) {
|
||||
(inner)
|
||||
|
||||
footer {
|
||||
hr class = "footline" {}
|
||||
div class = "footContainer" {
|
||||
p {
|
||||
"This site was built by hand with "
|
||||
(FarLink("https://rust-lang.org", "Rust"))
|
||||
", "
|
||||
(FarLink("https://maud.lambda.xyz", "Maud"))
|
||||
", "
|
||||
(FarLink("https://github.com/connorskees/grass", "Grass"))
|
||||
", and "
|
||||
(FarLink("https://docs.rs/axum/latest/axum", "Axum"))
|
||||
"."
|
||||
@if footer {
|
||||
footer {
|
||||
hr class = "footline" {}
|
||||
div class = "footContainer" {
|
||||
p {
|
||||
"This site was built by hand with "
|
||||
(FarLink("https://rust-lang.org", "Rust"))
|
||||
", "
|
||||
(FarLink("https://maud.lambda.xyz", "Maud"))
|
||||
", "
|
||||
(FarLink("https://github.com/connorskees/grass", "Grass"))
|
||||
", and "
|
||||
(FarLink("https://docs.rs/axum/latest/axum", "Axum"))
|
||||
"."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
32
crates/service/service-webpage/src/pages/notfound.rs
Normal file
32
crates/service/service-webpage/src/pages/notfound.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
use maud::html;
|
||||
use page::page::{Page, PageMetadata};
|
||||
|
||||
use crate::pages::page_wrapper;
|
||||
|
||||
pub fn notfound() -> Page {
|
||||
Page {
|
||||
meta: PageMetadata {
|
||||
title: "Betalupi: About".into(),
|
||||
author: None,
|
||||
description: None,
|
||||
image: Some("/assets/img/icon.png".to_owned()),
|
||||
backlinks: Some(false),
|
||||
},
|
||||
|
||||
generate_html: Box::new(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"}
|
||||
}
|
||||
};
|
||||
|
||||
page_wrapper(&page.meta, inner, false).await
|
||||
})
|
||||
}),
|
||||
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ fn build_server() -> Arc<PageServer> {
|
||||
|
||||
#[expect(clippy::unwrap_used)]
|
||||
server
|
||||
.with_404(pages::notfound())
|
||||
.add_page("/", pages::index())
|
||||
.add_page("/links", pages::links())
|
||||
.add_page("/whats-a-betalupi", pages::betalupi())
|
||||
|
||||
Reference in New Issue
Block a user