@metalsmith/drafts

    1.1.1 • Public • Published

    @metalsmith/drafts

    A metalsmith plugin to hide drafts.

    metalsmith: core plugin npm: version ci: build code coverage license: MIT

    Installation

    NPM:

    npm install @metalsmith/drafts

    Yarn:

    yarn add @metalsmith/drafts

    Usage

    Pass the plugin with any options to Metalsmith.use.

    const drafts = require('@metalsmith/drafts')
    
    metalsmith.use(drafts())
    metalsmith.use(drafts({ default: false })) // same as default

    Add draft: true to your files' YAML front-matter to mark them as drafts:

    ---
    title: My post
    draft: true
    ---

    Default value for draft

    You can instruct @metalsmith/drafts to mark files as draft by default if they don't have a draft property in their front-matter:

    const drafts = require('@metalsmith/drafts')
    
    metalsmith.use(
      drafts({
        default: true
      })
    )

    CLI Usage

    To use this plugin with the Metalsmith CLI, add @metalsmith/drafts to the plugins key in your metalsmith.json file:

    {
      "plugins": [
        {
          "@metalsmith/drafts": {
            "default": false
          }
        }
      ]
    }

    License

    MIT

    Install

    npm i @metalsmith/drafts

    DownloadsWeekly Downloads

    16

    Version

    1.1.1

    License

    MIT

    Unpacked Size

    6.94 kB

    Total Files

    5

    Last publish

    Collaborators

    • webketje
    • ismay
    • woodyrew
    • wernerglinka