CSS is not working via link rel attributes of maud with actix-web. Where I've made mistake(s)?
I think that position where I wrote link rel attributes is correct.
main.rs
use actix_files as fs;
use actix_web::{get, App, HttpServer, Result as AwResult};
use maud::{html, Markup};
#[get("/")]
async fn index() -> AwResult<Markup> {
Ok(html! {
head{
link rel="stylesheet" href="/static/style.css"{};
}
title{"Help me"}
p {"Blue text should be shown."}
})
}
#[actix_web::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(|| {
App::new()
.service(fs::Files::new("/static", ".").show_files_listing())
.service(index)
})
.bind("0.0.0.0:80")?
.run()
.await?;
Ok(())
}
style.css
p {
color: blue;
font-size: 50px;
}