decap-cms
decap-cms copied to clipboard
feat(slugs): allow filters in template strings
Process template filters first, then strip ' and . characters from slug strings.
Fixes #4783
Summary
Provides greater control over field values used in entry slug strings.
Test plan
Added a new formatters test which failed under the existing setup. Updated compileStringTemplate() function such that new test and all existing tests pass.
Checklist
- [x] I have read the contribution guidelines.
- [x] Code is formatted via running
yarn format. - [x] Tests are passing via running
yarn test. - [ ] The status checks are successful (continuous integration). Those can be seen below.

Also happy to update the docs if the rest of the code looks good 👍
Deploy Preview for decap-www canceled.
| Name | Link |
|---|---|
| Latest commit | 2645e07808c579426127b9b4e1aa94aef57d822e |
| Latest deploy log | https://app.netlify.com/sites/decap-www/deploys/648a76a5465c0e000830810b |
Could really use this feature, hopefully it gets approved and merged!
If this allows use setting for example our own slug filter, it would be awesome.
For example:
slug: {{title | my_own_slugify}}