0.1.0 • Published 10 years ago

metalsmith-metaobject v0.1.0

Weekly downloads
24
License
MIT
Repository
github
Last release
10 years ago

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)