https://github.com/uretgec/slugify
URL-friendly slugify with your languages support.
https://github.com/uretgec/slugify
go-slugify slug slugify
Last synced: 3 months ago
JSON representation
URL-friendly slugify with your languages support.
- Host: GitHub
- URL: https://github.com/uretgec/slugify
- Owner: uretgec
- License: mit
- Created: 2022-08-14T17:23:20.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-14T20:00:40.000Z (over 3 years ago)
- Last Synced: 2024-06-21T03:25:18.262Z (over 1 year ago)
- Topics: go-slugify, slug, slugify
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Slugify
URL-friendly slugify with your languages support.
## Install
```
go get -u github.com/uretgec/slugify
```
## Examples
Simple One
```go
package main
import (
"fmt"
"github.com/uretgec/slugify"
)
func main() {
title := slugify.Make("Hellö Wörld хелло ворлд", []string{`х`, "kh", `л`, "l"}...) // not good example but works
fmt.Println(title) // "hello-world-khello-vorld"
title = slugify.Make("影師", []string{`影`, "ying", `師`, "shi"}...) // not good example but works
fmt.Println(title) // "ying-shi"
title = slugify.Make("This & that")
fmt.Println(title) // "this-that"
title = slugify.Make("Çikolata Soslu Bulut Kek")
fmt.Println(title) // "cikolata-soslu-bulut-kek"
title = slugify.Make("Çikolata'nın Sosunda /Kendi ?Halinde -- Ne Üdüğü Belirsiz == -- - \" Bulut Kek")
fmt.Println(title) // "cikolatanin-sosunda-kendi-halinde-ne-udugu-belirsiz-bulut-kek"
}
```
## Tests
```
go test -timeout 30s github.com/uretgec/slugify
```