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