module:metalsmith-grouped-page/transforms/add-to-metadata

metalsmith-grouped-page/transforms/add-to-metadata

module.exports(options) ⇒ function

addToMetadata - transform for metalsmith-grouped-page that adds the grouped pages to metalsmith.metadata() sorted by slug

Kind: Exported function
Returns: function - transform function (doesn't do anything to groups in this case)

Param Type Description
options Object passed to addToMetadata
options.metakey String added as metalsmith.metadata.groupedPages.KEY
[ options.sort ] Array. < function() > | Array. < Object > | Array. < String > see lodash.orderby
[ options.order ] Array. < String > see lodash.orderby

module.exports~bySlug(group) ⇒ String

bySlug - default sort is by slug

Kind: inner method of module.exports
Returns: String - slug

Param Type Description
group Object current file object

module.exports~addToMetadata(groups, gpOptions, metalsmith) ⇒ Object

Does not modify the group page file objects, just adds to global metadata

Kind: inner method of module.exports
Returns: Object - groups (untouched)

Param Type Description
groups Object. < String, Object > key filename, value file object
gpOptions Object options passed to metalsmith-grouped-pages
metalsmith Object instance