Metalsmith Date Formatter
Format article/post dates based on YAML Front Matter (YFM) data and moment
## Installation
npm install --save-dev metalsmith-date-formatter
Usage
Front Matter:
---publishDate: 2015-05-30modifedDate: 2015-05-31---
JavaScript API:
var Metalsmith = ;var dateFormatter = ; ;
In your template::
published: {{ publishDate }}last modified: {{ modifiedDate }}
options
dates
This option takes multiple formats
array of objects with key
and format
properties.
- The
key
property is the YFM property name - The
format
property is optional but takes any moment format value
array of strings
string
format
Any date format that moment
accepts, defaults to MMMM DD, YYYY
Notes
The metalsmith cli workflow has not been tested