0.1.3 • Published 8 years ago
metalsmith-path-into-post v0.1.3
metalsmith-path-into-post
Add source file path into Metalsmith's post metadata. With this plugin each post knows where it is.
This tiny plugin is expected to be used in combination with metalsmith-collections and/or metalsmith-in-place.
Installation
$ npm install metalsmith-path-into-post --save
Usage
var Metalsmith = require('metalsmith');
var pathIntoPost = require('metalsmith-path-into-post');
Metalsmith(__dirname)
.use(pathIntoPost({
pattern: /\.md$/,
ext: '.html',
publicPathPrefix: '/'
})
.build();
or for CLI
{
"plugins": {
"metalsmith-permalinks": {
"pattern": "\\.md$",
"ext": ".html",
"publicPathPrefix": "/",
}
}
}
Options
pattern
RegExp to filter filesext
String to replace source file's extension withpublicPathPrefix
String to be prepended to source file path