Can Eta trim all the indentation and EOL when generating the output? I want the indentation when editing the template, and to trim the whitespace when saving the output into database.
I have enabled autoTrim like this,
const eta = new Eta({ views: "templates", autoTrim: ["nl", "slurp"] });
const html = eta.render("./dummy", data);
but the indentation and whitespaces are still in html.
@tjhoo Eta won't minify your HTML for you, autoTrim just enables trimming after Eta tags. But you could write a plugin to perform minification quite easily!
Hi I have a template (with indentation) that looks like the following,
Can
Eta
trim all the indentation and EOL when generating the output? I want the indentation when editing the template, and to trim the whitespace when saving the output into database.I have enabled
autoTrim
like this,but the indentation and whitespaces are still in
html
.