## Usage Works with [assemble][], [verb][], [generate][], [update][], or any [Template][]-based application. Just replace assemble in the examples with your application of choice. ### Preparation This requires front-matter to be parsed in advance. You can easily do this with [parser-front-matter][] like this: ```js var assemble = require('assemble'); var app = assemble(); // parse front matter on all `hbs` files app.onLoad(/\.hbs$/, function(view, next) { matter.parse(view, next); }); ``` ### Middleware usage Use as a middleware: ```js var expand = require('{%= name %}'); var assemble = require('assemble'); var app = assemble(); app.onLoad(/\.hbs$/, expand(app)); app.pages('*.hbs'); ``` ### Plugin usage **app plugin** Use as an "instance" plugin on `app` to expand templates in the front-matter of all views in all collections: ```js var expand = require('{%= name %}'); var assemble = require('assemble'); var app = assemble(); app.use(expand()); app.pages('*.hbs'); ``` **Collection plugin** Use as a collection instance plugin to expand templates in the front-matter of all views in the collection: ```js var expand = require('{%= name %}'); var assemble = require('assemble'); var app = assemble(); app.create('pages') .use(expand(app)); app.pages('*.hbs'); ``` **view plugin** Use as a view plugin to expand templates in the front-matter of a specific view: ```js var expand = require('{%= name %}'); var assemble = require('assemble'); var app = assemble(); app.create('pages') app.page('foo', {content: '...'}) .use(expand(app)) .render(function(err, res) { //=> do stuff to res }); ```