# metalsmith-include

> Make the contents of other source files as properties.

Latest version **0.0.2** (published 2015-06-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install metalsmith-include
pnpm add metalsmith-include
yarn add metalsmith-include
bun add metalsmith-include
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2015-06-03 |
| First published | 2014-05-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Trey Griffith |
| Maintainers | treygriffith |
| Keywords | metalsmith, partial, include |

## Links

- npm: https://www.npmjs.com/package/metalsmith-include
- Repository: https://github.com/treygriffith/metalsmith-include
- Issues: https://github.com/treygriffith/metalsmith-include/issues
- npm.io page: https://npm.io/package/metalsmith-include

## Dependencies (2)

- [async](https://npm.io/package/async.md) ^0.7.0
- [debug](https://npm.io/package/debug.md) ^0.8.1

## Recent versions

- 0.0.2 (latest) — 2015-06-03
- 0.0.1 — 2014-05-04

## README

# metalsmith-include

  Make the contents of other source files as properties on a metalsmith file object. Can be used as a rudimentary partial system for `metalsmith-templates`.

## Example

index.md:

<sub><sup>Note the lack of extension on `thanks` - this provides maximum flexibility, since you may have a markdown parser that converts `thanks.md` to `thanks.html`, and this plugin will search for any extension if none is provided</sup></sub>

```markdown
---
template: home.jade
include:
  thanks: thanks
---

### Welcome to my website!
```

home.jade:

```jade
.main
  !=contents

  !=thanks
```

thanks.md:

```markdown
---
template: thanks.jade
partial: true
---

#### Thanks for visiting!
```

thanks.jade:

```jade
.thanks
  !=contents
```

Output:

```html
<div class="main">
  <h3>Welcome to my website!</h3>

  <div class="thanks">
    <h4>Thanks for visiting!</h4>
  </div>
</div>
```

## Installation

    $ npm install metalsmith-include

## Options
  
  The only option is `deletePartials`, which tells `metalsmith-include` whether or not to remove files that are included in other files, and have a `partial` indicator in their front-matter. Defaults to true.

## CLI Usage

  Install via npm and then add the `metalsmith-include` key to your `metalsmith.json` plugins with your options passed as an object:

```json
{
  "plugins": {
    "metalsmith-include": {}
  }
}
```

## Javascript Usage

  Pass `options` to the include plugin and pass it to Metalsmith with the `use` method:

```js
var include = require('metalsmith-include');

metalsmith.use(include());
```

## License

  MIT

---
_Source: https://npm.io/package/metalsmith-include · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
