Minimal integration for Maud & Tailwind
This commit is contained in:
parent
05d3ea9fc6
commit
18ffc5f7ae
29
src/main.rs
29
src/main.rs
@ -1,11 +1,32 @@
|
|||||||
#[macro_use] extern crate rocket;
|
use rocket::fs::FileServer;
|
||||||
|
use maud::{Markup, html, DOCTYPE};
|
||||||
|
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate rocket;
|
||||||
|
|
||||||
#[get("/")]
|
#[get("/")]
|
||||||
fn index() -> &'static str {
|
fn index() -> Markup {
|
||||||
"Hello, world!"
|
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]
|
#[launch]
|
||||||
fn rocket() -> _ {
|
fn rocket() -> _ {
|
||||||
rocket::build().mount("/", routes![index])
|
rocket::build()
|
||||||
|
.mount("/", routes![index])
|
||||||
|
.mount("/static", FileServer::from("static"))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user