photoprism/pkg/txt/slug.go
Michael Mayer 4efa383c57 API: Proof-of-concept for form handling
We don't want to directly write to models so that only selected fields can be changed and values can be validated for security reasons.

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-02-02 03:36:00 +01:00

13 lines
189 B
Go

package txt
import "strings"
// SlugToTitle converts a slug back to a title
func SlugToTitle(s string) string {
if s == "" {
return ""
}
return Title(strings.Join(Words(s), " "))
}