djc / askama

Type-safe, compiled Jinja-like templates for Rust
Apache License 2.0
3.5k stars 221 forks source link

Conditional compiling - features #1076

Closed rtiagom closed 4 months ago

rtiagom commented 4 months ago

As seen in another issue, the following works:

{% if cfg!(debug_assertions) %}
    blah blah blah
{% endif %}

How to do the same for feature?

{% if cfg!(feature="web") %}
    blah blah blah
{% endif %}
rtiagom commented 4 months ago

My bad, I had a syntax error. It does work as expected.