medialize/ally.js

View on GitHub
build/metalsmith/helpers/collection-to-siblings.js

Summary

Maintainability
A
0 mins
Test Coverage
// collection-to-siblings
module.exports = function(context) {
  const _collections = context.data.root.collection;
  const collections = _collections.map(function(collectionName) {
    return context.data.root[collectionName];
  });

  context.data.root.siblings = collections[0] || [];
  context.data.root.currentCollectionName = _collections[0] || '';
};