Metalsmith plugin to convert a set of file metadata to moment date objects
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tests
.gitignore
.travis.yml
LICENSE
README.md
moment.js
package-lock.json
package.json

README.md

metalsmith-moment

A Metalsmith plugin to convert a set of file metadata to moment.js objects.

Build Status Dependency Status

Installation

$ npm install metalsmith-moment

JavaScript usage

var msMoment = require('metalsmith-moment');

metalsmith.use(msMoment(['published', 'modified']));

This will convert the published and modified properties to moment.js objects by applying moment.js parsing rules. Any falsy property is just ignored.

CLI usage

{
  "plugins": {
    "metalsmith-moment": ["published", "modified"]
  }
}

License

MIT