Skip to main content

Slugify

This config can be used to overwrite the function that is used to slugify your URLs. The function takes a single parameter which is the path before being slugified. It expects the return value to be the slugified URL.

For an introduction to patterns and how slugs are derived, see URL pattern. For the fallback behavior, see Default pattern.

Example:

config/plugins.js
import deburr from 'lodash/deburr';
import toLower from 'lodash/toLower';
import kebabCase from 'lodash/kebabCase';

export default ({ env }) => ({
webtools: {
config: {
slugify: (fieldValue) => kebabCase(deburr(toLower(fieldValue))),
},
},
});
NameDetails
Keyslugify
Requiredfalse
Typefunction