Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 

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/g,
                replacement: function() {
                    return 'str2';
                }
            }]
        }
    }))
    .use(replace({
        title: {
            patterns: [{
                match: 'a.md',
                replacement: 'b.md'
            }]
        }
    }))
    .build();

Options

see Applause

License

MIT

About

a replace plugin for metalsmith

Resources

Releases

No releases published

Packages

No packages published