Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
metalsmith-slug
Advanced tools
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.
npm install metalsmith-slug
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.
Add metalsmith-slug
to your metalsmith.json
.
{
"plugins": {
"metalsmith-slug": {}
}
}
Add metalsmith-slug
to your project and .use()
it.
var slug = require('metalsmith-slug');
metalsmith.use(slug());
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
}));
FAQs
slugify a property in metalsmith
The npm package metalsmith-slug receives a total of 25 weekly downloads. As such, metalsmith-slug popularity was classified as not popular.
We found that metalsmith-slug demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.