9th May 2020 at 2:17pm
purpose | returns each item in the list in a human-readable form for use in URLs or filenames |
---|---|
input | a selection of titles |
output | the input titles transformed so that they only contain lower case letters, numbers, periods, dashes and underscores |
Learn more about how to use Filters
Introduced in v5.1.23 The transformation applied by the slugify operator follows these steps:
- If there is a tiddler with the same title that has a slug field, then return that field instead of running the following steps
- Replace uppercase letters with lowercase equivalents
- Transliterate diacritics to their basic lowercase ASCII equivalents (for example, "Æ" is transliterated to "AE")
- Replace spaces with dashes
- Remove all non-word characters except dashes and periods
- Replace multiple sequential dashes with a single dash
- Trim dashes from start and end
- If the result is the empty string then character codes are used instead (eg. "&£@" transforms to "38-163-64")
Note that it is possible for more than one title to slugify to the same string. The duplicateslugs
can be used to alert authors to any clashes.