README
metalsmith-perma
metalsmith-perma
is an alternative to metalsmith-permalinks
for applying permalinks to your static content.
Installation
With npm:
npm install metalsmith-perma
With yarn:
yarn add metalsmith-perma
Usage
var metalsmith = require('metalsmith');
var permalinks = require('metalsmith-perma');
metalsmith(__dirname)
.use(permalinks({
pattern: ':title'
}));
metalsmith-perma uses slugify for converting patterns to permalinks. You can pass options to slugify with an options
parameter:
metalsmith.use(permalinks({
pattern: ':title'.
options: {
replacement: '-', // replace spaces with replacement
remove: null, // regex to remove characters
lower: true // result in lower case
}
}));
Slugify options
defaults to { lower: true, remove: /!