metalsmith-collection-metadata

1.0.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({
    pages: { type: 'page' },
    posts: { type: 'post' }
  }))

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

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    2
  • 0.1.0
    10

Package Sidebar

Install

npm i metalsmith-collection-metadata

Weekly Downloads

12

Version

1.0.0

License

MIT

Unpacked Size

3.7 kB

Total Files

4

Last publish

Collaborators

  • rbardini