JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1406
  • Score
    100M100P100Q20023F
  • License MIT

A metalsmith plugin to render files with templates.

Package Exports

  • metalsmith-templates

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (metalsmith-templates) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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