mikser-io-render-eta
v3.0.0
Published
[Eta](https://www.npmjs.com/package/eta) renderer for [Mikser](https://github.com/almero-digital-marketing/mikser-io). Renders entities whose layout uses the `.eta` template engine.
Readme
mikser-io-render-eta
Eta renderer for Mikser. Renders entities whose layout uses the .eta template engine.
Mikser doesn't pick your template engine for you — install the renderer that matches the syntax your team already knows. Eta is the small, fast, modern descendant of EJS — embedded JavaScript with sane defaults and async support. Mix freely with other engines in the same project (.eta, .hbs, .liquid can all coexist).
Install
npm install mikser-io-render-etaUsage
// mikser.config.js
import { layouts } from 'mikser-io'
import { renderEta } from 'mikser-io-render-eta'
export default {
plugins: [
layouts(),
renderEta({
autoEscape: true,
autoTrim: ['slurp', 'nl']
}),
]
}The options object is passed through to the Eta constructor — see Eta config. views is set to the layouts folder and cache defaults to true.
Templates render against the full render runtime as the data context, so any function exposed on runtime by another render-* plugin is callable directly:
<h1><%= entity.meta.title %></h1>
<%~ markdown(entity.meta.body) %>
<%~ include('partials/footer') %>License
MIT
