slug:支持多种语言的URL友好slugify

时间:2021-02-03 14:25:34
【文件属性】:
文件名称:slug:支持多种语言的URL友好slugify
文件大小:15KB
文件格式:ZIP
更新时间:2021-02-03 14:25:34
go slug GoGo ug 包slug从unicode字符串生成slug,URL友好的slugify具有多种语言支持。 例 package main import ( "fmt" "github.com/gosimple/slug" ) func main () { text := slug . Make ( "Hellö Wörld хелло ворлд" ) fmt . Println ( text ) // Will print: "hello-world-khello-vorld" someText := slug . Make ( "影師" ) fmt . Println ( someText ) // Will print: "ying-shi" enText := slug . MakeLang ( "This & that" , "en" ) fmt . Println ( enText ) // Will print: "this-and-that" deText := slug . MakeLang ( "Diese & Dass" , "de" ) fmt .
【文件预览】:
slug-master
----.gitignore(25B)
----README.md(2KB)
----doc.go(1KB)
----LICENSE(16KB)
----go.mod(116B)
----languages_substitution.go(2KB)
----slug_test.go(16KB)
----slug.go(5KB)
----go.sum(235B)
----.travis.yml(501B)

网友评论