mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-11-02 00:23:01 +00:00
Make navi-title better
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
"net/http"
|
||||
"path"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -55,3 +56,8 @@ func RandomString(n int) (string, error) {
|
||||
}
|
||||
return hex.EncodeToString(bytes), nil
|
||||
}
|
||||
|
||||
// Strip hypha name from all ancestor names, replace _ with spaces, title case
|
||||
func BeautifulName(uglyName string) string {
|
||||
return strings.Title(strings.ReplaceAll(path.Base(uglyName), "_", " "))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user