metalsmith-metaobject

0.1.0 • Public • Published

metalsmith-metaobject Build Status

A plugin to pass an object as metadata to metalsmith.

Note: If you want to load your metadata from external JSON files consider using metalsmith-metadata.

Installation

Install with npm.

npm install --save metalsmith-metaobject

CLI Usage

Install via npm and then add the metalsmith-metaobject key to your metalsmith.json plugins.

{
    "plugins": {
        "metalsmith-metaobject": {
            "author": {
                "name": "André König",
                "github": "akoenig",
                "email": "andre.koenig@posteo.de"
            },
            "feed": "/atom.xml"
        }
    }
}

Javascript Usage

Pass the options to Metalsmith#use:

var metaobject = require('metalsmith-metaobject');
 
metalsmith.use(metaobject({
    author: {
        name: 'André König',
        github: 'akoenig',
        email: 'andre.koenig@posteo.de'
    },
    feed: '/atom.xml'
}));

Template usage

After passing the respective meta data object to metalsmith you are able to use it in your templates: Example for handlebars:

{{ author.name }}

Changelog

Version 0.1.0 (20140427)

  • Initial Release

Author

Copyright 2014, André König (andre.koenig@posteo.de)

Package Sidebar

Install

npm i metalsmith-metaobject

Weekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • akoenig