mirror of
https://github.com/askama-rs/askama.git
synced 2025-09-29 22:11:17 +00:00
16 lines
288 B
Rust
16 lines
288 B
Rust
#![no_implicit_prelude]
|
|
|
|
use ::askama::Template;
|
|
|
|
#[derive(Template)]
|
|
#[template(path = "hello.html")]
|
|
struct HelloTemplate<'a> {
|
|
name: &'a str,
|
|
}
|
|
|
|
#[test]
|
|
fn main() {
|
|
let hello = HelloTemplate { name: "world" };
|
|
::std::assert_eq!("Hello, world!", hello.render().unwrap());
|
|
}
|