Skip to content
/ slug Public
forked from extemporalgenome/slug

golang package for producing safe slug strings

License

Notifications You must be signed in to change notification settings

stvp/slug

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

slug

slug is a package that sanitizes and normalizes strings for use in things like URLs by removing / converting characters that are not in the set [0-9A-Za-z]:

package main

import github.com/stvp/slug

func main() {
  slug.Clean("L'école 24") // "l_ecole_24"
  slug.Clean("\x00\x08clean") // "clean"
}

You can also customize the replacement string:

package main

import github.com/stvp/slug

func main() {
  slug.Replacement = '-'
  slug.Clean("L'école 24") // "l-ecole-24"
}

API docs

About

golang package for producing safe slug strings

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%