@escio/metalsmith-set-extension

Metalsmith plugin setting the extension of processed files.


Keywords
metalsmith, extension
License
ISC
Install
npm install @escio/metalsmith-set-extension@1.0.0

Documentation

@escio/metalsmith-set-extension

Metalsmith plugin setting the extension of processed files

Installation

$ npm install @escio/metalsmith-set-extension

Usage

The plugin has a single parameter, the extension you wish to set on the processed files. The existing extension is overwritten.

const metalsmith = require('metalsmith');
const setExtension = require('@escio/metalsmith-set-extension');

metalsmith(
    __dirname
).use(
    // Set the extension of all processed files to .html
    setExtension('.html')
).build((err) => {
    if (err) {
        throw err;
    }
});

License

ISC © Escio AS