Slugify a string with comprehensive Unicode transliteration and extensive customization options
94
Build a system that generates URL-friendly slugs for blog post titles in multiple languages, ensuring proper locale-specific character transliteration.
You need to implement a blog URL generator that:
Your implementation must handle these specific cases:
Implement a module that exports:
generateSlug(title: string, locale?: string): string that generates a slug with optional localegenerateLocalizedSlugs(posts: Array<{title: string, language: string}>): Array<{title: string, slug: string}> that processes multiple posts with their respective locales@generates
/**
* Generates a URL-safe slug from a title with optional locale-specific transliteration
* @param title - The blog post title to convert
* @param locale - Optional locale code (e.g., 'sv', 'de', 'tr') for locale-specific transliteration
* @returns A URL-safe slug string
*/
export function generateSlug(title: string, locale?: string): string;
/**
* Processes multiple blog posts and generates localized slugs
* @param posts - Array of posts with title and language properties
* @returns Array of posts with their generated slugs
*/
export function generateLocalizedSlugs(
posts: Array<{title: string, language: string}>
): Array<{title: string, slug: string}>;Provides string slugification with comprehensive Unicode transliteration and locale-specific conversion support.
Install with Tessl CLI
npx tessl i tessl/npm-sindresorhus--slugifydocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10