Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

metalsmith-inc

farinspace22MIT0.1.3

A metalsmith plugin to include partials.

readme

metalsmith-inc

A metalsmith plugin to include partials.

Installation

$ npm install metalsmith-inc

CLI Usage

Use the following in your metalsmith.json file (e.g. the defaults are displayed). Be sure to read more about defining a RegExp pattern as a string and the normal string escaping rules that apply.

{
  "plugins": {
    "metalsmith-inc": {
      "directory": ".",
      "pattern": "^include (.*)"
    }
  }
}

Javascript Usage

var inc = require('metalsmith-inc');
metalsmith.use(inc({
  directory: "docs/partial",
  pattern: "^custom (.*)"
}));

Example

---
title: Sample
---

# Exploring Partials

include partial-abc.md

include partial-xyz.md

# More Markdown

A markdown paragraph

License

MIT