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.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25
increased by31.58%
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'
}));

renameFiles boolean: When set to true, will rename the files passed to metalsmith-slug to the file's new slug property.

metalsmith.use(slug({
  renameFiles: true
}));

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc