frontend: beautiful URLs
This commit is contained in:
parent
bd75157a79
commit
0c540a39eb
13 changed files with 54 additions and 31 deletions
10
libfic/utils.go
Normal file
10
libfic/utils.go
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
package fic
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
)
|
||||
|
||||
func ToURLid(str string) string {
|
||||
re := regexp.MustCompile("[^a-zA-Z0-9]+")
|
||||
return re.ReplaceAllLiteralString(str, "-")
|
||||
}
|
||||
Reference in a new issue