frontend: beautiful URLs

This commit is contained in:
nemunaire 2018-01-18 11:07:50 +01:00 committed by nemunaire
commit 0c540a39eb
13 changed files with 54 additions and 31 deletions

10
libfic/utils.go Normal file
View 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, "-")
}