From 67b3a91a233b7bcc516e8f43b71c865b5b5c62c7 Mon Sep 17 00:00:00 2001 From: Pierre Berthe <42767265+MrTsunami4@users.noreply.github.com> Date: Thu, 25 Jul 2024 12:42:04 +0200 Subject: [PATCH] Fix browser console warning --- src/common.rs | 2 +- src/main.rs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/common.rs b/src/common.rs index ef2114b..1934d39 100644 --- a/src/common.rs +++ b/src/common.rs @@ -88,5 +88,5 @@ pub async fn style() -> impl IntoResponse { .get_style_str() .to_string(); - ([("content-type", "style/css")], style) + ([("content-type", "text/css")], style) } diff --git a/src/main.rs b/src/main.rs index 81f58de..366c5a5 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}; +use maud::{html, Escaper, Markup, PreEscaped, DOCTYPE}; use serde::{Deserialize, Serialize}; use store::Store; use tokio::net::TcpListener; @@ -50,6 +50,7 @@ async fn main() -> Result<()> { async fn home() -> Markup { html!( + (DOCTYPE) (head("")) body { content { @@ -71,6 +72,7 @@ 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 { @@ -94,6 +96,7 @@ 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 { @@ -120,6 +123,7 @@ async fn topic(Path(name): Path, State(state): State) -> impl }; html!( + (DOCTYPE) (head(&name)) body { content { @@ -210,6 +214,7 @@ fn sanithize_identifier(input: &str) -> String { async fn create() -> impl IntoResponse { html!( + (DOCTYPE) (head("créer")) body { content { @@ -242,6 +247,7 @@ async fn create() -> impl IntoResponse { fn error(message: impl ToString) -> Markup { let message = message.to_string(); html!( + (DOCTYPE) (head("Failure")) body { content {