Get published date and modified date of the each page published by Netlify
Last updated 2 months ago by sounisi5011 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @sounisi5011/metalsmith-netlify-published-date 
SYNC missed versions from official npm registry.


Go to the latest release page on npm License: MIT Supported Node.js version: >=8.3.0 Install Size Details Dependencies Status Build Status Maintainability Status

Get published date and modified date of the each page published by Netlify.


npm install @sounisi5011/metalsmith-netlify-published-date@0.3.2


There is an example of a working configuration in the ./example/ directory.
Please check: https://github.com/sounisi5011/metalsmith-netlify-published-date/tree/v0.3.2/example


This release is unstable. Some options may be change or remove before version 1.x is released.

To see a list of the latest commit options, see the type definition in the ./src/plugin.ts file: https://github.com/sounisi5011/metalsmith-netlify-published-date/blob/v0.3.2/src/plugin.ts#L32-L64

Also check the test code in the ./test/options/ directory for options available in the JSON file: https://github.com/sounisi5011/metalsmith-netlify-published-date/tree/v0.3.2/test/options


Only files that match this pattern will be processed.
Specify a glob expression string or an array of strings as the pattern.
Pattern are verified using multimatch v4.0.0.


Site ID that indicates the website to lookup on Netlify.
When building on Netlify, this value is automatically set from the environment variable URL.
When building in the development environment, you need to specify the siteID option or add the environment variable URL.


If you are building a private website on Netlify, you need to specify the accessToken option.
The value to specify for this option can be generated on the following page (Note: you must be logged into Netlify): https://app.netlify.com/user/applications


Specify the Metalsmith plugins that generate the content to be deployed to Netlify using the date metadata obtained.

Only set plugins that are fast in this option.
A simple plugins that only has the function to convert files using date metadata is ideal.
This is because the plug-ins specified in this option are executed many times to compare with the preview on Netlify.


Specify the function of the following features: convert the file name of the before convert files into the path of the Web page published on Netlify.

e.g. If a file with extension .pug is converted to a file with extension .html, the following function should be set:

const netlifyPublishedDate = require('@sounisi5011/metalsmith-netlify-published-date');

    filename2urlPath: filename => filename.replace(/\.pug$/, '.html'),

Note: The return value of the function is delimited by the path delimiter and then URL escaped. That is, the value that this function must return is not a URL, but a file path before it is converted to a URL.


Use metadataUpdater option if you want to update Metalsmith metadata just before executing the build process to determine the modified date.
Content converted with the function specified in this option is used for content comparison.

The page data obtained from the Netlify preview is passed to the first argument. Parse this data and update the Metalsmith metadata passed in the second argument.

See the set-datetime.js file in the ./example/ directory for verbose usage: https://github.com/sounisi5011/metalsmith-netlify-published-date/blob/v0.3.2/example/set-datetime.js


This function converts the content generated by the plugin specified in the plugins option and the content of the web page obtained from the Netlify preview.
Content converted with the function specified in this option is used for content comparison.

In other words, this function is used to remove HTML elements that should be excluded in the comparison.
See the remove-time-elem.js file in the ./example/ directory for verbose usage: https://github.com/sounisi5011/metalsmith-netlify-published-date/blob/v0.3.2/example/remove-time-elem.js


Specify the directory to save the cache file that holds the response data obtained from Netlify.

If set null, an in-memory cache using the Map object is used.

By default, it is set in the directory where the package is installed.
In a normal configuration, this package is installed under the node_modules/ directory.
For this reason, Netlify probably keep the cache generated by the production build.

Debug mode

This plugin supports debugging output.
To enable, use the following command when running your build script:

DEBUG=@sounisi5011/metalsmith-netlify-published-date,@sounisi5011/metalsmith-netlify-published-date:* node my-website-build.js

For more details, please check the description of debug v4.1.1.


To run the test suite, first install the dependencies, then run npm test:

npm install
npm test



Current Tags

  • 0.3.2                                ...           latest (2 months ago)

7 Versions

  • 0.3.2                                ...           2 months ago
  • 0.3.1                                ...           2 months ago
  • 0.3.0                                ...           2 months ago
  • 0.2.0                                ...           6 months ago
  • 0.1.2                                ...           6 months ago
  • 0.1.1                                ...           6 months ago
  • 0.1.0                                ...           7 months ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 42
Dependencies (9)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |