Skip to content
This repository has been archived by the owner on Aug 19, 2018. It is now read-only.

A Metalsmith plugin to extract untemplatized file contents.

License

Notifications You must be signed in to change notification settings

gillesfabio/metalsmith-untemplatize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

metalsmith-untemplatize

A Metalsmith plugin to extract untemplatized file contents.

Use Case

This can be pretty useful when you need to access file contents without any template rendering in other templates (such as RSS/Atom feeds).

Installation

$ npm install --save metalsmith-untemplatize

CLI Usage

{
  "plugins": {
    "metalsmith-untemplatize": {
      "key": "untemplatized"
    }
  }
}

API Usage

var untemplatize = require('metalsmith-untemplatize');
metalmisth.use(untemplatize({
  key: 'untemplatized'
}));

Plugin Order

Be sure to add this plugin before metalsmith-templates and after any rendering content plugin like metalsmith-markdown.

Example:

Metalsmith(__dirname)
  .use(markdown())
  .use(untemplatize())
  .use(templates('handlebars'))
  .build();

Options

key

The key name which stores the untemplatized content. Defaults to untemplatized. Feel free to use your own (example: content, body, banana or anything else).

License

MIT

About

A Metalsmith plugin to extract untemplatized file contents.

Resources

License

Stars

Watchers

Forks

Packages

No packages published