4 ms·
In the linked Go approach, and also with Askama, you have to define each template (component) twice. Once as a .html file, and then again as a struct inside a s
by jackothy 2y ago
In the linked Go approach, and also with Askama, you have to define each template (component) twice. Once as a .html file, and then again as a struct inside a source file.
With Maud, templates/components are only defined once, so you no longer have to worry about keeping the two in sync or colocating them.
This is because Maud provides a macro for writing HTML with Rust-like syntax, so all your HTML (components) ends up inside regular Rust files, and you can refer to variables as usual.
This really makes for almost seamless integration between Rust code and the HTML you serve.