forgejo/models/theme/theme_name.go
2025-06-03 13:50:33 +02:00

14 lines
411 B
Go

package theme
import "strings"
// getFriendlyThemeName converts an raw theme name to a friendly, readable name.
// Example: forgejo-dark -> Forgejo Dark, catppuccin-maroon-auto -> Catppuccin Maroon Auto
func getFriendlyThemeName(themeName string) string {
themeName = strings.ReplaceAll(themeName, "-", " ")
themeName = strings.ToLower(themeName)
themeName = strings.Title(themeName)
return themeName
}