replace - _ with whitespace for default homepage.name

This commit is contained in:
yusing 2024-10-03 10:19:31 +08:00
parent e6b4630ce9
commit 4f09dbf044
2 changed files with 8 additions and 3 deletions

View file

@ -59,7 +59,12 @@ func (cfg *Config) HomepageConfig() H.HomePageConfig {
} }
if item.Name == "" { if item.Name == "" {
item.Name = U.Title(alias) item.Name = U.Title(
strings.ReplaceAll(
strings.ReplaceAll(alias, "-", " "),
"_", " ",
),
)
} }
if p.GetType() == PR.ProviderTypeDocker { if p.GetType() == PR.ProviderTypeDocker {

View file

@ -10,11 +10,11 @@ type (
Icon string `yaml:"icon" json:"icon"` Icon string `yaml:"icon" json:"icon"`
URL string `yaml:"url" json:"url"` // URL or unicodes URL string `yaml:"url" json:"url"` // URL or unicodes
Category string `yaml:"category" json:"category"` Category string `yaml:"category" json:"category"`
SourceType string `yaml:"source_type" json:"source_type"`
Description string `yaml:"description" json:"description"` Description string `yaml:"description" json:"description"`
WidgetConfig map[string]any `yaml:",flow" json:"widget_config"` WidgetConfig map[string]any `yaml:",flow" json:"widget_config"`
Initialized bool `yaml:"-" json:"-"` SourceType string `yaml:"-" json:"source_type"`
Initialized bool `yaml:"-" json:"-"`
} }
) )