metalsmith-assets-convention

2.1.1 • Public • Published

Metalsmith Assets Convention Plugin NPM version

Build Status Dependency Status Greenkeeper badge

Metalsmith plugin to define static asset files through file conventions.

Installation

npm install --save metalsmith-assets-convention

CLI

If you are using the command-line version of Metalsmith, you can install via npm, and then add the metalsmith-assets-convention key to your metalsmith.json file:

{
  "plugins": {
    "metalsmith-assets-convention": {
      "extname": ".assets"
    }
  }
}

JavaScript

If you are using the JS Api for Metalsmith, then you can require the module and add it to your .use() directives:

var assets = require('metalsmith-assets-convention');
 
metalsmith.use(assets({
  extname: '.assets'
}));

Usage

Each static file copy is handled through naming the <name>.assets files. The file's metadata options are passed off to metalsmith-assets to copy the assets. All metalsmith-assets options apply, defined through each .static file:

Example

src/public.assets

---
source: public
destination: .
---
Copy all the public files into the build directory.
  • source represents the path to the original assets.
  • destination represents the path to where the final files will live. When not provided, will be where the original .asset file existed.

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i metalsmith-assets-convention

Weekly Downloads

1

Version

2.1.1

License

MIT

Unpacked Size

6.33 kB

Total Files

5

Last publish

Collaborators

  • robloach