metalsmith-save-timestamp
v0.1.0
Published
Metalsmith plugin to save file timestamps as the date in gray matter content
Keywords
Readme
metalsmith-save-timestamp
Metalsmith plugin to save file timestamps as the date in gray matter content.
Installation
$ npm install metalsmith-save-timestampUsage
const metalsmith = require('metalsmith')
const saveFileTimestamp = require('metalsmith-save-timestamp')
metalsmith(__dirname)
.use(saveFileTimestamp())You can configure the plugin by passing an object containing options:
metalsmith(__dirname)
.use(saveFileTimestamp(
pattern: [ 'category/*' ],
overrideDate: false,
lastModified: false
))Options
patternArray/String A glob pattern for files to be included. (Default: [ '**/*' ])overrideDateBoolean Set to true to replace the date field even if it already exists in gray matter. (Default: false)lastModifiedBoolean Set to true to also set themodifiedattribute in gray matter. (Default: false)
