Add versioned board canvas persistence and stable SEO slugs
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package platform
|
||||
|
||||
import "regexp"
|
||||
|
||||
var slugPattern = regexp.MustCompile(`^[a-z0-9]+(-[a-z0-9]+)*$`)
|
||||
|
||||
var uuidSlugPattern = regexp.MustCompile(`^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`)
|
||||
|
||||
// Slugs remain stable across renames unless explicitly changed by an authorized edit.
|
||||
func validSlug(slug *string) bool {
|
||||
return slug == nil || (len(*slug) <= 100 && slugPattern.MatchString(*slug) && !uuidSlugPattern.MatchString(*slug))
|
||||
}
|
||||
Reference in New Issue
Block a user