export default function sluggify(text: string): string { return text .toLowerCase() // Convert to lowercase .trim() // Remove leading/trailing whitespace .normalize("NFD") // Normalize special characters .replace(/[\u0300-\u036f]/g, "") // Remove diacritics .replace(/[^a-z0-9\s-]/g, "") // Remove special characters except spaces and hyphens .replace(/\s+/g, "-") // Replace spaces with hyphens .replace(/-+/g, "-") // Replace multiple hyphens with single hyphen .slice(0, 100); // Limit length to 100 characters }