@combino/plugin-eta
Version:
ETA template engine plugin for Combino
61 lines (43 loc) • 1.13 kB
Markdown
ETA template engine plugin for Combino.
```bash
npm install @combino/plugin-eta
```
```javascript
import { createCombino } from 'combino';
import etaPlugin from '@combino/plugin-eta';
const combino = createCombino({
plugins: [etaPlugin()],
});
// Use with your templates
await combino.generate({
templates: ['my-template'],
outputDir: './output',
});
```
- Processes ETA templates with `<%`, `<%=`, and `<%-` syntax
- Supports layout functionality with `<% layout('layout-name') %>`
- Automatic layout file resolution with multiple extensions
- Configurable file patterns for processing
- Supports all ETA options and features
```javascript
etaPlugin({
patterns: ['*.eta', '*.md', '*.html'], // Files to process
autoEscape: true,
autoTrim: false,
// ... other ETA options
});
```
Use explicit layouts in your templates:
```eta
<% layout('base') %>
<h1>Hello <%= name %></h1>
```
The plugin will automatically find layout files with extensions: `.eta`, `.ejs`, `.md`, `.html`, `.txt`.
MIT