Website/node_modules/metalsmith-date-in-filename
2015-12-04 02:31:39 -05:00
..
node_modules/lodash Paper rendering works, and news fields get populated correctly now. 2015-12-04 02:31:39 -05:00
test Paper rendering works, and news fields get populated correctly now. 2015-12-04 02:31:39 -05:00
.npmignore Paper rendering works, and news fields get populated correctly now. 2015-12-04 02:31:39 -05:00
.travis.yml Paper rendering works, and news fields get populated correctly now. 2015-12-04 02:31:39 -05:00
index.js Paper rendering works, and news fields get populated correctly now. 2015-12-04 02:31:39 -05:00
package.json Paper rendering works, and news fields get populated correctly now. 2015-12-04 02:31:39 -05:00
README.md Paper rendering works, and news fields get populated correctly now. 2015-12-04 02:31:39 -05:00

metalsmith-date-in-filename

Enrich file metadata with date info present in source filenames.

Build Status npm version

Installation

npm install --save-dev metalsmith-date-in-filename

Usage

Set the date in the filename:

2014-11-04-file.md
date-can-2014-11-04-go-anywhere.md
like in parenthesis (2014-11-04).md
20141104-compact-format.md
compact-20141104.md

Then in your code:

var Metalsmith = require('Metalsmith');
var dateInFilename = require('metalsmith-date-in-filename');
Metalsmith(__dirname)
    .use(dateInFilename({override: true}))
    .build();

... alternatively, you can pass just a boolean to the plugin, and the override setting will be set to it:

...
    .use(dateInFilename(true))
...

CLI Usage

{
    "plugins": {
        "metalsmith-date-in-filename": {"override": true}
    }
}

License

ISC