{"id":21428639,"url":"https://github.com/jaynetics/sexy_slug","last_synced_at":"2025-07-14T10:32:17.139Z","repository":{"id":56895181,"uuid":"175190229","full_name":"jaynetics/sexy_slug","owner":"jaynetics","description":"A Ruby gem to create slugs from Strings.","archived":false,"fork":false,"pushed_at":"2023-05-14T21:23:44.000Z","size":25,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-06T18:17:53.096Z","etag":null,"topics":["activesupport","cleanurl","human-readable","ruby","slug"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaynetics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-12T10:45:15.000Z","updated_at":"2021-12-30T22:21:11.000Z","dependencies_parsed_at":"2024-11-22T22:14:16.431Z","dependency_job_id":"15a56413-9a0e-4032-8a57-47d34be17917","html_url":"https://github.com/jaynetics/sexy_slug","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/jaynetics/sexy_slug","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaynetics%2Fsexy_slug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaynetics%2Fsexy_slug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaynetics%2Fsexy_slug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaynetics%2Fsexy_slug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaynetics","download_url":"https://codeload.github.com/jaynetics/sexy_slug/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaynetics%2Fsexy_slug/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265280824,"owners_count":23739857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["activesupport","cleanurl","human-readable","ruby","slug"],"created_at":"2024-11-22T22:14:09.781Z","updated_at":"2025-07-14T10:32:14.241Z","avatar_url":"https://github.com/jaynetics.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Gem Version](https://badge.fury.io/rb/sexy_slug.svg)](http://badge.fury.io/rb/sexy_slug)\n[![Build Status](https://github.com/jaynetics/sexy_slug/workflows/tests/badge.svg)](https://github.com/jaynetics/sexy_slug/actions)\n[![Coverage](https://codecov.io/gh/jaynetics/sexy_slug/branch/main/graph/badge.svg?token=FpzD4EeIXa)](https://codecov.io/gh/jaynetics/sexy_slug)\n\n# SexySlug\n\nThis is a Ruby gem that builds [slugs](https://en.wikipedia.org/wiki/Clean_URL#Slug) from Strings.\n\nIt is similar to [`StringEx' String#to_url`](https://github.com/rsl/stringex/#actsasurl), but more lightweight.\n\nThese are the main things that SexySlug does differently:\n\n- depends on activesupport\n- leaves core classes untouched\n- makes a few more transformations (*[see specs](https://github.com/jaynetics/sexy_slug/blob/master/spec/sexy_slug_spec.rb)*)\n- does not transliterate non-latin scripts (*[why?](#transliterations)*)\n- provides no ActiveRecord mixin\n- is less customizable\n- is about five times faster (*[see benchmark](https://gist.github.com/jaynetics/b024ffa19ce28c731289bd880b492b0b)*)\n\n## Installation\n\n`gem install sexy_slug` or add it to your Gemfile.\n\n## Usage\n\n```ruby\nSexySlug.from('Hi there!') # =\u003e 'hi-there'\nSexySlug.from('Mambo #5') # =\u003e 'mambo-number-five'\nI18n.with_locale(:de) { SexySlug.from('Mambo #5') } # =\u003e 'mambo-nummer-fuenf'\n```\n\n\u003ca name='customization'\u003e\u003c/a\u003e\n### Customization\n\nSimply change the contents of the `SexySlug::PROCESSORS` Array.\n\n```ruby\nSexySlug::PROCESSORS.delete(SexySlug::UsuallyTransliterableChar)\nSexySlug::PROCESSORS.unshift(MyCustomProcessor)\n```\n\n\u003ca name='transliterations'\u003e\u003c/a\u003e\n## Why no universal transliterations?\n\nSluggification is always a fuzzy business, but transliteration in particular is almost guaranteed to produce incorrect results.\n\nIn many languages, codepoints don't map one-to-one to pronunciations, so their correct transliteration is context-dependent. Some relevant issues are e.g. [allophones](https://en.wikipedia.org/wiki/Allophone), [crasis](https://en.wikipedia.org/wiki/Crasis), [digraphs](https://de.wikipedia.org/wiki/Digraph), [sandhi](https://en.wikipedia.org/wiki/Sandhi), and shared scripts.\n\nDespite some restraint, `sexy_slug` isn't completely \"i18n-proof\", e.g.:\n- it might mistranslate money amounts, as the dollar sign is also used for non-dollar currencies\n- it always transliterates umlauts, which isn't appropriate for languages such as Turkish\n\nSee [customization](#customization) on how to avoid this if needed.\n\n## Similar/related projects\n\n- [babosa](https://github.com/norman/babosa)\n- [friendly_id](https://github.com/norman/friendly_id)\n- [stringex](https://github.com/rsl/stringex)\n\n## Contributing\n\nFeel free to send suggestions, point out issues, or submit pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaynetics%2Fsexy_slug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaynetics%2Fsexy_slug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaynetics%2Fsexy_slug/lists"}