New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

metalsmith-slug

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metalsmith-slug

slugify a property in metalsmith

0.0.2
Source
npm
Version published
Weekly downloads
55
292.86%
Maintainers
1
Weekly downloads
 
Created
Source

metalsmith slug

Add a slug property to the metadata for targeted files in your Metalsmith, based on a particular property. Useful for generating links to pages based on, say, their title.

Installation

npm install metalsmith-slug

Usage

If you're not familiar with Metalsmith, check it out. It's a very versatile file processor that can be used for static site generation, project scaffolding and more.

Metalsmith CLI

Add metalsmith-slug to your metalsmith.json.

{
  "plugins": {
    "metalsmith-slug": {}
  }
}

Metalsmith JavaScript API

Add metalsmith-slug to your project and .use() it.

var slug = require('metalsmith-slug');

metalsmith.use(slug());

Options

patterns [array]: Glob patters of files to match. Uses minimatch.

metalsmith.use(slug({
  patterns: ['*.md', '*.rst'] // Deafults to metalsmith.source() directory
}));

property 'string': Property to generate the slug from.

metalsmith.use(slug({
  property: 'name' // Defaults to 'title'
}));

slug options: You can additionally use any of the options available to node-slug

metalsmith.use(slug({
  replacement: '_', // Defaults to node-slug defaults
  symbols: false
}));

Keywords

metalsmith

FAQs

Package last updated on 15 Jun 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts