feat(frontend): create volume

This commit is contained in:
Nicolas Meienberger
2025-08-16 14:22:24 +02:00
parent 03a1203f7e
commit d13763995e
7 changed files with 254 additions and 33 deletions

View File

@@ -0,0 +1,18 @@
package core
import (
"regexp"
"strings"
)
var nonAlnum = regexp.MustCompile(`[^a-z0-9_-]+`)
var hyphenRuns = regexp.MustCompile(`[-_]{2,}`)
func Slugify(input string) string {
s := strings.ToLower(strings.TrimSpace(input))
s = nonAlnum.ReplaceAllString(s, "-")
s = hyphenRuns.ReplaceAllString(s, "-")
s = strings.Trim(s, "-")
return s
}