【文件属性】:
文件名称:metalsmith-ids:用于向文件添加数字 ID 的 Metalsmith 插件
文件大小:2KB
文件格式:ZIP
更新时间:2021-06-08 14:44:22
JavaScript
metalsmith-ids
一个插件,它根据字段排序(默认日期)为您的文件分配一个数字 ID。
特征
分配数字 ID
安装
$ npm install metalsmith-ids
用法
var ids = require ( 'metalsmith-ids' ) ;
metalsmith . use ( ids ( ) ) ;
还有其他选项具有以下默认值:
metalsmith . use ( ids ( {
sortBy : 'date' ,
reverse : false
} ) ) ;
您可以更改这些选项:
metalsmith . use ( ids ( {
sortBy : 'counter' , // sort by the custom field -counter- of each file
reverse : true // newe
【文件预览】:
metalsmith-ids-master
----package.json(722B)
----README.md(918B)
----lib()
--------index.js(657B)