Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

metalsmith-elevate

0.0.0 • Public • Published

metalsmith-elevate

A metalsmith plugin for bumping files up one or more directories.

Similar to metalsmith-flatten, but omits chunks of the filepath entirely. Useful for organizing elements in the source but not in the build.

Currently a 0.0.0 release. Use at your own risk!

Installation

$ npm install metalsmith-elevate

Usage

Basic Example

var Metalsmith = require('metalsmith');
var elevate = require('metalsmith-elevate');
 
var metalsmith = new Metalsmith(__dirname)
  .use(flatten('blog/*/*.html));

This will move all files matched by blog/*/*.html up one directory.

Before:

blog/
├── 2014/
|   ├── one.html
|   └── two.html
└── 2015/
    ├── three.html
    └── four.html

After:

blog/
├── one.html
├── two.html
├── three.html
└── four.html

Options

You can pass a pattern to the plugin directly or an object specifying one or more of these options.

Option Default Description
pattern '*/**/*' One or more globs for multimatch.
depth -1 Negative numbers slice the file path relative to the number of segments it has. Positive numbers slice to that length.

Keywords

none

install

npm i metalsmith-elevate

Downloadsweekly downloads

1

version

0.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability