Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@borisschapira/eleventy-plugin-better-slug
Advanced tools
A plugin to improve Eleventy slug filter
In Eleventy v0.8.3, the slug
filter don't remove reserved characters for URL and HTML ids. This plugin aims at fixing that, replacing the standard slug
filter by a new one.
Uses the enhanced slug
filter to convert a string into a URL slug. Can be used in pagination or permalinks.
Removed characters: .~\:,;/?=#[]{}()@!'*+
Examples:
John's car
=> johns-car
10 O'Clock Live
=> 10-oclock-live
E!
=> e
Me, Myself & I
=> me-myself-and-i
Add the plugin to your project with:
npm add @borisschapira/eleventy-plugin-better-slug --save
Then, in you .eleventy.js
file:
// At the begining of the file
const pluginBetterSlug = require("@borisschapira/eleventy-plugin-better-slug");
…
module.exports = function(eleventyConfig) {
…
eleventyConfig.addPlugin(pluginBetterSlug);
…
}
By design, this `slug' filter deletes all reserved characters but you can use a custom configuration to modify the characters to be deleted and even replace some characters.
const pluginBetterSlug = require("@borisschapira/eleventy-plugin-better-slug");
…
module.exports = function(eleventyConfig) {
…
const options = {
extensions: {
"'": "-"
}
}
eleventyConfig.addPlugin(pluginBetterSlug, {});
…
}
The options
object is defined as follows:
removals
(optional): a string containing the characters to remove (any value overwrites the default value)extensions
(optional): a charset of all the characters replacements (any new key-value pair is added to the default library)FAQs
A plugin to improve Eleventy slug filter
We found that @borisschapira/eleventy-plugin-better-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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.