mirror of
https://github.com/askama-rs/askama.git
synced 2025-10-02 07:20:55 +00:00
25 lines
319 B
Rust
25 lines
319 B
Rust
use askama::Template;
|
|
|
|
enum Greeting {
|
|
Hello,
|
|
Hey,
|
|
Hi,
|
|
}
|
|
|
|
#[derive(Template)]
|
|
#[template(
|
|
ext = "txt",
|
|
source = r#"
|
|
{%- match greeting -%}
|
|
{%- when Hello -%} Hello!
|
|
{%- when Hey -%} Hey!
|
|
{%- when Hi -%} Hi!
|
|
{%- endmatch -%}"#
|
|
)]
|
|
struct Greeter {
|
|
greeting: Greeting,
|
|
}
|
|
|
|
fn main() {
|
|
}
|