No description
Find a file
Ian Storm Taylor f2c87b09d8 0.1.0
* add `string` engine convenience
2014-03-05 21:11:21 -08:00
lib 0.1.0 2014-03-05 21:11:21 -08:00
test 0.1.0 2014-03-05 21:11:21 -08:00
.gitignore first commit 2014-02-04 21:47:35 -08:00
History.md 0.1.0 2014-03-05 21:11:21 -08:00
Makefile first commit 2014-02-04 21:47:35 -08:00
package.json 0.0.6 2014-02-07 19:43:04 -08:00
Readme.md 0.1.0 2014-03-05 21:11:21 -08:00

metalsmith-templates

A metalsmith plugin to render files with templates.

You can use any templating engine supported by consolidate.js.

Installation

$ npm install metalsmith-templates

CLI Usage

Install the node modules and then add the metalsmith-templates key to your metalsmith.json plugins. The simplest use case just requires the template engine you want to use:

{
  "plugins": {
    "metalsmith-templates": "handlebars"
  }
}

  If you want to specify additional options, pass an object:

```json
{
  "plugins": {
    "metalsmith-templates": {
      "engine": "handlebars",
      "directory": "templates"
    }
  }
}

Javascript Usage

For the simplest use case, just pass your templating engine:

var templates = require('metalsmith-templates');

metalsmith.use(templates('swig'));

Pass options to the templates plugin and pass it to Metalsmith with the use method:

metalsmith.use(templates({
  engine: 'swig',
  directory: 'templates'
}));

License

MIT