Is it not possible to style Rocket tera
or handlebar
template engine using external css.
I'm my case I have the following directory setup
I want to be able to use style.css
in index.html.tera
Is it not possible to style Rocket tera
or handlebar
template engine using external css.
I'm my case I have the following directory setup
I want to be able to use style.css
in index.html.tera
If rocket is setup to also serve static files from a directory, the path in the href
property should be relative to that directory, not to the template file.
See the doc here: StaticFiles in rocket_contrib::serve - Rust
As the error message says, the version of Rocket you are using requires a nightly version of Rust (this is because it uses unstable features). You should probably upgrade to Rocket 0.5-rc, which supports stable Rust.
Im using v0.5rc
Ah, I see the problem! rocket_contrib
only works with Rocket 0.4, and has been replaced with more fine-grained crates going forward.
Template support for 0.5 lives in rocket_dyn_templates
, and static file support is now part of the main rocket
crate: FileServer in rocket::fs - Rust
Thank you
I'll check that out
Also I need to connect with MySQL via diesel I don't know if there's a new crate to do this other
I was able to get the template engine play nicely in development. But I'm getting the following error in production
Here's my source
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.