Json
You can serialize json in your template with serde::Serialize
{{ @json foo }}
{{ @json_pretty foo }}
Don't escape html characters.
If you are looking to paint it as html text (like "Text" in <h1>Text</h1>
):
<h1>{{ serde_json::to_string(&foo).map_err(|_| yarte::Error)? }}</h1>