remove special characters in sluggification

This commit is contained in:
Corwin 2024-05-12 15:41:31 +01:00
parent 839ee3b6f7
commit 4f18f1bc62
No known key found for this signature in database
2 changed files with 6 additions and 2 deletions

View file

@ -6,7 +6,7 @@ export const metadata: Metadata = {
title: "Dungeon Puzzler Redirect", title: "Dungeon Puzzler Redirect",
}; };
const REDIRECT_TO = "/showcase/the-dungeon-puzzler's-lament"; const REDIRECT_TO = "/showcase/the-dungeon-puzzlers-lament";
export default function DplRedirectPage() { export default function DplRedirectPage() {
redirect(REDIRECT_TO); redirect(REDIRECT_TO);

View file

@ -1,3 +1,7 @@
export function slugify(x: string) { export function slugify(x: string) {
return x.toLowerCase().split(" ").join("-"); return x
.toLowerCase()
.split(" ")
.join("-")
.replace(/[^a-zA-Z0-9\-]/, "");
} }