static-engine-params
v1.10.2
Published
Plugin for static-engine. Extracts properties from the file property of each object in the collection.
Downloads
9
Readme
static-engine-params
This is a plugin for static-engine. Traverses every object in the collection and matches up all file properties to a route. Parameters from that matching are added to the object. Call it with a string that's the route to match and a object that is converters for the parameters.
var engine = require('static-engine')
var file = require('static-engine-params')
var pluginA = require('plugin-a')
var moment = require('moment')
engine([
pluginA,
file('./content/:categories+/:date.:slug.md', {
date: function (date) {
return moment(date, 'x')
}
})
])