5 unstable releases

0.3.2 Jan 19, 2024
0.3.1 Jan 2, 2024
0.3.0 Mar 7, 2022
0.2.0 Aug 27, 2021
0.1.0 Jun 7, 2021

#22 in #tera-templates

Download history 4/week @ 2024-09-18 8/week @ 2024-09-25 1/week @ 2024-10-02

51 downloads per month

MIT/Apache

69KB
971 lines

Welcome to Trillium!

📖 Guide 📖

The guide provides an architectural overview and lay of the land connecting the trillium crates.

📑 Rustdocs 📑

The rustdocs represent the best way to learn about any of trillium's individual crates and the specific interfaces.




Legal:

Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

this crate provides the tera templating language for trillium

See the tera site for more information on the tera template language.

use trillium::Conn;
use trillium_tera::{TeraHandler, Tera, TeraConnExt};

let mut tera = Tera::default();
tera.add_raw_template("hello.html", "hello {{name}} from {{render_engine}}")?;

let handler = (
TeraHandler::new(tera),
|conn: Conn| async move { conn.assign("render_engine", "tera") },
|conn: Conn| async move {
conn.assign("name", "trillium").render("hello.html")
}
);

use trillium_testing::prelude::*;
assert_ok!(
get("/").on(&handler),
"hello trillium from tera",
"content-type" => "text/html"
);

Dependencies

~13–22MB
~377K SLoC