mylloon.fr/src/template.rs
2023-02-09 11:19:53 +01:00

9 lines
266 B
Rust

use askama::DynTemplate;
use minify_html::{minify, Cfg};
pub fn render_html(template: &dyn DynTemplate) -> String {
let data = template.dyn_render().unwrap();
let cfg = Cfg::spec_compliant();
String::from_utf8(minify(data.as_bytes(), &cfg)).unwrap()
}