This package has been deprecated

Author message:

Functionality of metalsmith-mtime is now fully integrated into metalsmith core.

metalsmith-mtime

0.0.3 • Public • Published

DEPRECATED

This plugin is deprecated, its functionality is now fully integrated into Metalsmith core.

Since version 0.10.0 Metalsmith adds full file stats to metadata. If you're using metalsmith-mtime with 0.10, or newer, version of Metalsmith, replace mtime, in your code, with stats.mtime and remove "metalsmith-mtime" from dependencies.

metalsmith-mtime

A Metalsmith plugin that adds files last modification times to their Metalsmith metadata.

Build Status Coverage Status npm version Dependency Status devDependency Status License MIT

This plugin iterates over Metalsmith files and adds mtime property to metadata of each entry in files that corresponds to file existing in filesystem. Value of this property is an instance of Date representing files last modification time.

mtime property can be used e.g. in a template (here we use swig):

Last modified: {{ mtime|date('Y.m.d H:i') }}

Installation

$ npm install metalsmith-mtime

Usage

JavaScript

var mtime = require('metalsmith-mtime');

metalsmith.use(mtime()));

CLI

Add the metalsmith-mtime key to your metalsmith.json plugins:

{
  "plugins": {
    "metalsmith-mtime": true
  }
}

Tips

If you keep source code of your website in Git, be aware that Git does not store file mtimes. So to use this plugin you would also need one of additional tools for handling metadata in Git.

Package Sidebar

Install

npm i metalsmith-mtime

Weekly Downloads

0

Version

0.0.3

License

MIT

Last publish

Collaborators

  • jkuczm