This commit is contained in:
Kirill Zhuravlev 2023-02-14 21:26:37 +01:00 committed by Avelino
parent e318f94283
commit b750341e0d
No known key found for this signature in database
GPG Key ID: B345B4D52E98180A
2 changed files with 2 additions and 0 deletions

View File

@ -122,6 +122,7 @@ func mkdirAll(path string) error {
}
// NOTE: directory is not exists
// FIXME: fix rights
if err := os.MkdirAll(path, 0o755); err != nil {
return err
}

View File

@ -8,6 +8,7 @@ import (
// Generate slugs similar to GitHub's slugs on markdown parsing
func Generate(text string) string {
// FIXME: this is should be like regexp.Replace(`[^-a-zA-Z\d]+`, ``)
s := strings.ReplaceAll(text, "/", "")
return slugify.Slugify(strings.TrimSpace(s))
}