Skip to content

How to automatically replace %20 in dynamic routing so when you go to link it uses dash like /sycamore-den #5738

Answered by aubergene
half-metal asked this question in Q&A
Discussion options

You must be logged in to vote

I would create a slug and store and index that. The slugify function should be idempotent so you can then safely slugify the param before looking for it in the database.

https://www.npmjs.com/package/slugify

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@half-metal
Comment options

Answer selected by half-metal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants