2.2.4 • Published 5 years ago
metalsmith-collections-tree v2.2.4
metalsmith-collections-tree
create nested metadata from the metalsmith-collections global metadata
Installation
$ npm install metalsmith-collections-tree
or
$ yarn add metalsmith-collections-tree
Usage
Create collections tree after metalsmith-collections:
var collectionsTree = require('metalsmith-collections-tree');
metalsmith.use(collections());
metalsmith.use(collectionsTree({
sortKey: 'path',
extension: 'html'
}));
Extra
1) Allows advanced custom sorting to be matched with metalsmith-collections.
See an example here!
2) File details are now passed through. Which works with the following PR for metalsmith-permalinks.
Notes
collections trees are accessible via "collections-tree" metadata for each collection or ".all"
License
MIT