Minimal integration for Maud & Tailwind

main
Araozu 2024-02-09 19:24:06 -05:00
parent 05d3ea9fc6
commit 18ffc5f7ae
1 changed files with 25 additions and 4 deletions

View File

@ -1,11 +1,32 @@
#[macro_use] extern crate rocket;
use rocket::fs::FileServer;
use maud::{Markup, html, DOCTYPE};
#[macro_use]
extern crate rocket;
#[get("/")]
fn index() -> &'static str {
fn index() -> Markup {
html! {
(DOCTYPE)
html {
head {
title { "Hello, world!" }
link rel="stylesheet" type="text/css" href="/static/css/output.css";
}
body {
h1 class="text-xl text-red-500 bg-slate-300 px-2 py-4 rounded-full font-black" {
"Hello, world!"
}
p { "Welcome to my website!" }
}
}
}
}
#[launch]
fn rocket() -> _ {
rocket::build().mount("/", routes![index])
rocket::build()
.mount("/", routes![index])
.mount("/static", FileServer::from("static"))
}