Expand description

Handlebars templating handler for trillium based on the handlebars crate.

use trillium_handlebars::{HandlebarsHandler, HandlebarsConnExt};
let handler = (
    HandlebarsHandler::new("**/*.hbs"),
    |mut conn: trillium::Conn| async move {
        conn.assign("name", "handlebars")
            .render("examples/templates/hello.hbs")
    }
);

use trillium_testing::prelude::*;
assert_ok!(get("/").on(&handler), "hello handlebars!");

Re-exports

Structs

  • A struct for accumulating key-value data for use in handlebars templates. The values can be any type that is serde serializable
  • The single entry point of your Handlebars templates
  • A trillium handler that provides registered templates to downsequence handlers

Traits

  • Extension trait that provides handlebar rendering capabilities to [trillium::Conn]s.