Skip to navigation Skip to main content
11ty Logo Sustainability Fundraising
Eleventy Documentation
Toggle Menu
Eleventy 5.81s
Gatsby 43.36s

slugify Universal Filter Added in v1.0.0

Uses the @sindresorhus/slugify npm package to convert a string into a URL slug. Typically used with permalinks.

title: "My Title"
permalink: "/{{ title | slugify }}/"
Outputs to `/my-title/`.
In versions prior to 1.0.0, the slug Universal Filter was used. To maintain backwards compatibility moving forward, slug is still included and supported but slugify is now recommended as best practice—it has better default behavior for URLs with special characters.
slugify currently ignores characters for Japanese, Chinese, and others. If you need to slugify these characters, add your own universal filter with an alternative library like limax or transliteration. (More context at Issue #2537)

Changing slug to slugify Jump to heading

If you’re trying to migrate the content in a pre-1.0 project from using the slug filter to the (new in v1.0) slugify filter (note: this is optional—you can leave them as-is!), you must take extra care to make sure that any existing URLs don’t change.

The Upgrade Helper plugin will compare the slug and slugify versions of your URLs to see if there are any that require extra attention (thank you to Peter deHaan for the assist here!).

Other pages in Filters: