No description
Find a file
2014-03-06 14:40:19 -08:00
lib add shorthand for pattern matching 2014-03-06 14:40:19 -08:00
test add shorthand for pattern matching 2014-03-06 14:40:19 -08:00
.gitignore first commit 2014-02-05 15:06:46 -08:00
History.md 0.0.3 2014-02-06 23:16:04 -08:00
Makefile first commit 2014-02-05 15:06:46 -08:00
package.json add matching by pattern, fixes #2 2014-03-06 14:33:37 -08:00
Readme.md first commit 2014-02-05 15:06:46 -08:00

metalsmith-collections

A Metalsmith plugin that adds collections of files to the global metadata.

Installation

$ npm install metalsmith-collections

CLI Usage

Install via npm and then add the metalsmith-collections key to your metalsmith.json plugins, like so:

{
  "plugins": {
    "metalsmith-collections": {
      "articles": {
        "sortBy": "date",
        "reverse": true
      }
    }
  }
}

And then in your files themselves, add a collection and the optional field you want to sort by:

---
title: My Article
collection: articles
date: 2013-02-21
---

My article contents...

All of the files with a matching collection will be added to an array that is exposed as a key of the same name on the global Metalsmith metadata.

Javascript Usage

Pass the plugin to Metalsmith#use:

var collections = require('metalsmith-collections');

metalsmith.use(collections());

License

MIT