92 lines
2 KiB
Rust
92 lines
2 KiB
Rust
use axum::response::IntoResponse;
|
|
use maud::{html, Markup};
|
|
use stylist::{css, GlobalStyle};
|
|
|
|
pub fn head(title: &str) -> Markup {
|
|
html!(
|
|
head {
|
|
title { "Recueil " (title) }
|
|
link rel = "stylesheet" href = "/style.css";
|
|
}
|
|
)
|
|
}
|
|
|
|
pub fn header() -> Markup {
|
|
html!(
|
|
header {
|
|
a href = "/" { h1 { "Motifs" } }
|
|
a href = "/activity" { "activité" }
|
|
a href = "/topics" { "sujets" }
|
|
a href = "/create" { "créer" }
|
|
}
|
|
)
|
|
}
|
|
|
|
pub fn footer() -> Markup {
|
|
html!(
|
|
footer {
|
|
a href = "https://barnulf.net" { "barnulf.net" }
|
|
p { "Propulsé par la rouille." }
|
|
}
|
|
)
|
|
}
|
|
|
|
pub async fn style() -> impl IntoResponse {
|
|
#[allow(non_upper_case_globals)]
|
|
let style = GlobalStyle::new(css!(
|
|
page, html, body, content {
|
|
padding: 0;
|
|
border: 0;
|
|
margin: 0;
|
|
overflow-x: hidden;
|
|
}
|
|
|
|
body {
|
|
background-color: #181818;
|
|
color: white;
|
|
display: grid;
|
|
place-items: start center;
|
|
}
|
|
|
|
content {
|
|
background-color: #202020;
|
|
min-height: 100vh;
|
|
width: 100vw;
|
|
max-width: 1000px;
|
|
border-left: 1px solid #ffffff16;
|
|
border-right: 1px solid #ffffff16;
|
|
display: grid;
|
|
grid-template-rows: auto 1fr auto;
|
|
}
|
|
|
|
header {
|
|
border-bottom: 1px solid #ffffff16;
|
|
display: flex;
|
|
place-items: center;
|
|
padding-left: 2rem;
|
|
gap: 2rem;
|
|
}
|
|
|
|
a {
|
|
color: wheat;
|
|
}
|
|
|
|
main {
|
|
padding: 2rem;
|
|
}
|
|
|
|
footer {
|
|
border-top: 1px solid #ffffff16;
|
|
display: flex;
|
|
place-items: center;
|
|
padding-left: 2rem;
|
|
gap: 2rem;
|
|
}
|
|
|
|
))
|
|
.expect("Fails to compile style.")
|
|
.get_style_str()
|
|
.to_string();
|
|
|
|
([("content-type", "text/css")], style)
|
|
}
|