A Metalsmith plugin to convert a set of file metadata to moment.js objects.
This plugin requires Node.js 20 or later
$ npm install metalsmith-moment
const 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.
{
"plugins": {
"metalsmith-moment": ["published", "modified"]
}
}
MIT