metalsmith-replace

1.0.0 • Public • Published

metalsmith-replace

NPM version Dependencies Status

An attribute's value replace plugin for metalsmith

use Applause to replace.

Install

metalsmith-replace

Usage

var metalSmith = require('metalsmith');
var replace = require('metalsmith-replace');
 
var metalsmith = metalSmith(__dirname);
metalsmith
    .source('post')
    .use(replace({
        title: {
            patterns: [{
                match: 'aaa',
                replacement: 'bbb'
            }]
        },
        content: {
            patterns: [{
                match: 'str1',
                replacement: function() {
                    return 'str2';
                }
            }]
        }
    }))
    .use(replace({
        title: {
            patterns: [{
                match: 'a.md',
                replacement: 'b.md'
            }]
        }
    }))
    .build();

Options

see Applause

License

MIT

Package Sidebar

Install

npm i metalsmith-replace

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • jeremial
  • treri