keystatic icon indicating copy to clipboard operation
keystatic copied to clipboard

Slug field: execute `generate` on every save to ensure valid slugs

Open JohannaPeanut opened this issue 1 year ago • 1 comments

Hi It's nice that we can give the user control over slugs, that makes sense in some places. But it would be very helpful if generate is not only executed on "Regenerate"-Click but also on every save. I had assumed that this would happen, but unfortunately the CMS user can "break" the slug with spaces, non-alphanumeric characters etc.

JohannaPeanut avatar Jul 04 '24 08:07 JohannaPeanut

Hi ! I had the same issue with a CMS user who broke his home page for this reason (whitespace and comma in a slug). Maybe a validation property on fields.slug to reject slugs containing whitespaces or special chars could do the trick ?

henri42 avatar Jul 13 '24 08:07 henri42