Move template management to settings (#5811)
This commit is contained in:
16
shared/utils/slugify.ts
Normal file
16
shared/utils/slugify.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import slug from "slug";
|
||||
|
||||
slug.defaults.mode = "rfc3986";
|
||||
|
||||
/**
|
||||
* Convert a string to a slug that can be used in a URL in kebab-case format,
|
||||
* and remove periods.
|
||||
*
|
||||
* @param text The text to convert
|
||||
* @returns The slugified text
|
||||
*/
|
||||
export default function slugify(text: string): string {
|
||||
return slug(text, {
|
||||
remove: /[.]/g,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user