Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 2.03 KB

README.md

File metadata and controls

58 lines (41 loc) · 2.03 KB

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