Skip to content

elixir package for generating slugs and extracting id:s

Notifications You must be signed in to change notification settings

emilindstrom/slugs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slugs hex.pm version hex.pm downloads Build Status

generate creates a slug from a combination of two values, preferably a combination of an id and a descriptive string.

extract_id grabs the id from the slug.

https://hex.pm/packages/slugs

Installation

If available in Hex, the package can be installed by adding slugs to your list of dependencies in mix.exs:

def deps do
  [
    {:slugs, "~> 0.1.1"}
  ]
end

Usage

iex> Slug.generate(1337, "Lord Of The Rings")
"lord-of-the-rings-1337"

iex> Slug.extract_id("lord-of-the-rings-1337")
1337

About

elixir package for generating slugs and extracting id:s

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages