diff --git a/src/common.rs b/src/common.rs index 1934d39..111c07a 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1,9 +1,10 @@ use axum::response::IntoResponse; -use maud::{html, Markup}; +use maud::{html, Markup, DOCTYPE}; use stylist::{css, GlobalStyle}; pub fn head(title: &str) -> Markup { html!( + (DOCTYPE) head { title { "Recueil " (title) } link rel = "stylesheet" href = "/style.css"; diff --git a/src/main.rs b/src/main.rs index 6d76178..2fd083d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ use axum::{ }; use chrono::prelude::*; use common::{footer, head, header, style}; -use maud::{html, Escaper, Markup, PreEscaped, DOCTYPE}; +use maud::{html, Escaper, Markup, PreEscaped}; use serde::{Deserialize, Serialize}; use store::Store; use tokio::net::TcpListener; @@ -51,7 +51,6 @@ async fn main() -> Result<()> { async fn home() -> Markup { html!( - (DOCTYPE) (head("")) body { content { @@ -73,7 +72,6 @@ async fn home() -> Markup { async fn topics(State(state): State) -> impl IntoResponse { let topics = state.store.read().unwrap().list().unwrap(); html!( - (DOCTYPE) (head("sujets")) body { content { @@ -97,7 +95,6 @@ async fn topics(State(state): State) -> impl IntoResponse { async fn activity(State(state): State) -> impl IntoResponse { let topics = state.store.read().unwrap().activity().unwrap(); html!( - (DOCTYPE) (head("activité")) body { content { @@ -124,7 +121,6 @@ async fn topic(Path(name): Path, State(state): State) -> impl }; html!( - (DOCTYPE) (head(&name)) body { content { @@ -218,7 +214,6 @@ fn sanithize_identifier(input: &str) -> String { async fn create() -> impl IntoResponse { html!( - (DOCTYPE) (head("créer")) body { content { @@ -251,7 +246,6 @@ async fn create() -> impl IntoResponse { fn error(message: impl ToString) -> Markup { let message = message.to_string(); html!( - (DOCTYPE) (head("Failure")) body { content {