How to Automatically Generate a Slug Without Using Sanity Studio

1 replies
Last updated: Jul 6, 2022
Hello, I am trying to auto generate a slug without using sanity studio, I am making a post where the user mutates the data and then next page will show the submitted post, any ideas how I can implement this without generating the slug manually? Much appreciated.
Jul 2, 2022, 9:30 AM
Hey
user M
! You'll need to write some sort of function or use an existing package to create a slug. There aren't any options for autogenerating one when submitting content via the API.
Jul 6, 2022, 3:53 PM

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?