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

metalsmith-collection-metadata

0.1.0 • Public • Published

metalsmith-collection-metadata

npm package version Dependency status JavaScript Standard Style

A Metalsmith plugin to add metadata to every file in a collection.

Requires metalsmith-collections.

Installation

$ npm install metalsmith-collection-metadata

Usage

To add metadata to a collection, you must assign a metadata object to a property that points to the location of that collection. For example:

import collections from 'metalsmith-collections'
import metadata from 'metalsmith-collection-metadata'
 
metalsmith
  .use(collections({
    pages: 'pages/*.md',
    posts: 'posts/*.md'
  }))
  .use(metadata({
    'collections.pages': {
      type: 'page'
    },
    'collections.posts': {
      type: 'post'
    }
  }))

Adds a type property to every file in the pages and posts collections.

License

MIT

install

npm i metalsmith-collection-metadata

Downloadsweekly downloads

21

version

0.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability