Render A Basic Template From JSON Data With MiniJinja In Rust
March 2023
This is a quick example showing how to take a string of JSON and use it as data to populate a MiniJinja template.
---
minijinja =
serde_json = "1.0.111"
---
use Environment;
use Value;
Output:
<h1>Hello, World</h1>
Notes
- The example has lines for using files as input that have been commented out in favor of inline Strings. This makes the example directly runnable without dependencies.
-
The two creates that were added for this are
minijinjaandserde_json
end of line