This package has been deprecated

Author message:

This package is no longer maintained and has moved to the @metalsmith org; Please migrate to the following package: @metalsmith/drafts

metalsmith-drafts

1.0.0 • Public • Published

Metalsmith Drafts

npm version code style: prettier metalsmith: plugin

Build Status

A metalsmith plugin to hide drafts.

Installation

$ npm install metalsmith-drafts

CLI Usage

Install via npm and then add the metalsmith-drafts key to your metalsmith.json plugins, like so:

{
  "plugins": {
    "metalsmith-drafts": true
  }
}

Then in your files YAML front-matter add draft: true. In case you want to force all files to be set to draft: true, use the following plugin-option:

{
  "plugins": {
    "metalsmith-drafts": {
        "default": true
    }
  }
}

Javascript Usage

Pass the plugin to Metalsmith#use, like so:

var drafts = require('metalsmith-drafts');
 
metalsmith.use(drafts());

Then in your files YAML front-matter add draft: true.

Default value for draft

If you want to define a default value for draft (in case they are not definied in the YAML front-matter, then use the plugin option default:

var drafts = require('metalsmith-drafts');
 
metalsmith.use(drafts( {
    default: true
}));

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

  • Version
    Downloads (Last 7 Days)
    • Published

Package Sidebar

Install

npm i metalsmith-drafts

Weekly Downloads

48

Version

1.0.0

License

MIT

Unpacked Size

7.06 kB

Total Files

23

Last publish

Collaborators

  • f2prateek
  • ianstormtaylor
  • segmentio
  • webketje
  • woodyrew