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

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

install

npm i metalsmith-replace

Downloadsweekly downloads

9

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability