diff options
Diffstat (limited to 'book/src')
-rw-r--r-- | book/src/template_syntax.md | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/book/src/template_syntax.md b/book/src/template_syntax.md index c3635eb..755d283 100644 --- a/book/src/template_syntax.md +++ b/book/src/template_syntax.md @@ -18,7 +18,7 @@ Assignments can't be imported by other templates. Assignments use the `let` tag: -```text +```jinja {% let name = user.name %} {% let len = name.len() %} @@ -31,6 +31,16 @@ Assignments use the `let` tag: {{ val }} ``` +Like Rust, Askama also supports shadowing variables. + +```jinja +{% let foo = "bar" %} +{{ foo }} + +{% let foo = "baz" %} +{{ foo }} +``` + For compatibility with Jinja, `set` can be used in place of `let`. ## Filters |