Neolithic Psychedelic Mushrooms
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

metalsmith-auto-collections

0.1.4 • Public • Published

metalsmith-auto-collections

Automatically use metalsmith-collections. The collection name is equal to the parent directory of each file.

Installation

yarn add metalsmith-auto-collections [-D]

Usage

const Metalsmith = require('metalsmith')
const collect = require('metalsmith-auto-collections')
 
const ms = Metalsmith(__dirname)
 
// add all files to a collection
ms.use(collect())
 
// use globs to only set certain files to a collection
ms.use(collect({
  pattern: ['**/*.md', '!*.md']
}))
 
// pass settings to `metalsmith-collections`
ms.use(collect({
  pattern: '**/*.md',
  settings: {
    sortBy: 'date',
    reverse: true
  }
}))

To see the available options, see the metalsmith-collections repo.

Keywords

none

install

npm i metalsmith-auto-collections

Downloadsweekly downloads

429

version

0.1.4

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar