开发者社区> 镜像站> NPM> metalsmith-build-date
metalsmith-build-date
A Metalsmith plugin that adds a build date to the metadata.
Last updated 5 years ago by lambtron .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install metalsmith-build-date 
SYNC missed versions from official npm registry.

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 <string>

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

Current Tags

  • 0.2.0                                ...           latest (5 years ago)

3 Versions

  • 0.2.0                                ...           5 years ago
  • 0.1.0                                ...           7 years ago
  • 0.0.1                                ...           7 years ago
Downloads
Today 0
This Week 4
This Month 1
Last Day 0
Last Week 9
Last Month 21
Dependencies (0)
None
Dev Dependencies (2)