A Metalsmith plugin that adds a build date to the metadata.
JavaScript Makefile
Latest commit 473ad71 Dec 17, 2015 @lambtron lambtron Merge pull request #2 from davidosomething/master
Add 'key' option, bump to 0.2.0
Permalink
Failed to load latest commit information.
lib add 'key' option Dec 18, 2015
test add 'key' option Dec 18, 2015
.gitignore first commit Feb 7, 2014
History.md 0.1.0 Mar 7, 2014
Makefile first commit Feb 7, 2014
Readme.md add 'key' option Dec 18, 2015
package.json add 'key' option Dec 18, 2015

Readme.md

metalsmith-build-date

A Metalsmith plugin that adds a build date to the metadata. Useful for atom.xml or other feeds.

Installation

$ npm install metalsmith-build-date

Usage

var date = require('metalsmith-build-date');

metalsmith.use(date());

That will add a global date property to your metadata, so you can use it in a template like:

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <updated>{{ date }}</updated>

Options

key

Change the key from the default value of 'date' to whatever you want. Useful if you already have a date in your frontmatter for the file, or if you want to be more specific about what the date represents.

Example:

metalsmith.use(date({ key: 'dateBuilt' ));

CLI Usage

Install via npm and then add the metalsmith-build-date key to your metalsmith.json:

{
  "plugins": {
    "metalsmith-build-date": true
  }
}

License

MIT