https://github.com/peferron/slug
Generate URL-friendly slugs in Go.
https://github.com/peferron/slug
go golang slug slugify
Last synced: 5 months ago
JSON representation
Generate URL-friendly slugs in Go.
- Host: GitHub
- URL: https://github.com/peferron/slug
- Owner: peferron
- License: mit
- Created: 2014-06-15T08:32:01.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2015-05-23T03:48:01.000Z (about 11 years ago)
- Last Synced: 2024-06-21T03:17:51.623Z (about 2 years ago)
- Topics: go, golang, slug, slugify
- Language: Go
- Homepage:
- Size: 383 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# slug [](https://godoc.org/github.com/peferron/slug) [](https://travis-ci.org/peferron/slug) [](https://coveralls.io/r/peferron/slug?branch=master)
slug is a Go library for generating URL-friendly [slugs](http://en.wikipedia.org/wiki/Slug_%28web_publishing%29#Slug).
## Examples
Before and after:
- `A Lovely Day` → `a-lovely-day`
- `Living in 北京` → `living-in-bei-jing`
## Usage
```go
package main
import "github.com/peferron/slug"
func main() {
s := slug.Generate("Hello World")
print(s) // Prints "hello-world"
}
```
See the full [API reference](https://godoc.org/github.com/peferron/slug).