metalsmith-templates

A metalsmith plugin to render files with templates.

MIT 17 个版本
安装
npm install metalsmith-templates
yarn add metalsmith-templates
pnpm add metalsmith-templates
bun add metalsmith-templates
README

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:

{
  "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'));

To specify additional options:

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

License

MIT

版本列表
0.7.0 2015-03-30
0.6.1 2015-03-01
0.6.0 2014-10-03
0.5.2 2014-07-09
0.5.1 2014-06-11
0.5.0 2014-04-29
0.4.0 2014-04-02
0.3.0 2014-03-11
0.2.1 2014-03-10
0.2.0 2014-03-09
0.1.0 2014-03-06
0.0.6 2014-02-08
0.0.5 2014-02-07
0.0.4 2014-02-07
0.0.3 2014-02-06
0.0.2 2014-02-05
0.0.1 2014-02-05