Skip to content

Metalsmith plugin to allow defining Metadata through file conventions.

License

Notifications You must be signed in to change notification settings

kalamuna/metalsmith-metadata-convention

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Metalsmith Metadata Convention Plugin NPM version

Build Status Dependencies Status

Metalsmith plugin to allow defining Metadata by using file conventions.

Installation

npm install --save metalsmith-metadata-convention

CLI

If you are using the command-line version of Metalsmith, you can install via npm, and then add the metalsmith-metadata-convention key to your metalsmith.json file:

{
  "plugins": {
    "metalsmith-metadata-convention": {}
  }
}

JavaScript

If you are using the JS Api for Metalsmith, then you can require the module and add it to your .use() directives:

var metadata = require('metalsmith-metadata-convention');

metalsmith.use(metadata());

Usage

Each metadata object is constructed through files named <name>.metadata. All files with the .metadata extension are merged into Metalsmith's metadata object.

Example

src/authors.metadata

---
Stephen King:
  birthdate: 1947
J. K. Rowling:
  birthdate: 1965
William Shakespeare:
  birthdate: 1564
Nora Roberts:
  birthdate: 1950
---

This is a list of authors that are loaded into Metalsmith metadata at:
  metalsmith.metadata().authors

License

MIT

About

Metalsmith plugin to allow defining Metadata through file conventions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published