404
This commit is contained in:
@@ -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! {
|
||||
@@ -110,6 +113,9 @@ pub fn page_wrapper<'a>(
|
||||
title { (PreEscaped(meta.title.clone())) }
|
||||
|
||||
|
||||
// Use a small blurred placeholder while full-size images load.
|
||||
// Requires no other special scripts or css, just add some tags
|
||||
// to your <img>!
|
||||
script {
|
||||
(PreEscaped("
|
||||
window.onload = function() {
|
||||
@@ -133,27 +139,36 @@ pub fn page_wrapper<'a>(
|
||||
}
|
||||
|
||||
body {
|
||||
div class="wrapper" {
|
||||
main { (inner) }
|
||||
main{
|
||||
div class="wrapper" 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"))
|
||||
"."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user