From 4f09dbf044c3e17dd88fa06bfa76adbcdc08d1f4 Mon Sep 17 00:00:00 2001 From: yusing Date: Thu, 3 Oct 2024 10:19:31 +0800 Subject: [PATCH] replace - _ with whitespace for default homepage.name --- internal/config/query.go | 7 ++++++- internal/homepage/homepage.go | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/internal/config/query.go b/internal/config/query.go index c752d7c..c113041 100644 --- a/internal/config/query.go +++ b/internal/config/query.go @@ -59,7 +59,12 @@ func (cfg *Config) HomepageConfig() H.HomePageConfig { } if item.Name == "" { - item.Name = U.Title(alias) + item.Name = U.Title( + strings.ReplaceAll( + strings.ReplaceAll(alias, "-", " "), + "_", " ", + ), + ) } if p.GetType() == PR.ProviderTypeDocker { diff --git a/internal/homepage/homepage.go b/internal/homepage/homepage.go index ea10d4e..0a08407 100644 --- a/internal/homepage/homepage.go +++ b/internal/homepage/homepage.go @@ -10,11 +10,11 @@ type ( Icon string `yaml:"icon" json:"icon"` URL string `yaml:"url" json:"url"` // URL or unicodes Category string `yaml:"category" json:"category"` - SourceType string `yaml:"source_type" json:"source_type"` Description string `yaml:"description" json:"description"` WidgetConfig map[string]any `yaml:",flow" json:"widget_config"` - Initialized bool `yaml:"-" json:"-"` + SourceType string `yaml:"-" json:"source_type"` + Initialized bool `yaml:"-" json:"-"` } )