Add document type field

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Jonathan
2025-06-02 20:40:38 +02:00
committed by Sacha Al Himdani
parent 7a65ec8672
commit 7d2d26aab5
20 changed files with 166 additions and 253 deletions

View File

@@ -20,3 +20,13 @@ export function faviconUrl(url?: string | null): string | null {
return null;
}
}
export function slugify(str: string): string {
return str
.normalize("NFD") // split an accented letter in the base letter and the acent
.replace(/[\u0300-\u036f]/g, "") // remove all previously split accents
.toLowerCase()
.trim()
.replace(/[^a-z0-9 ]/g, "") // remove all chars not letters, numbers and spaces (to be replaced)
.replace(/\s+/g, "-");
}