fixed homepage not respecting homepage.show field, disabled schema validation for included file

This commit is contained in:
yusing
2024-10-04 08:36:32 +08:00
parent 6211ddcdf0
commit e566fd9b57
6 changed files with 33 additions and 15 deletions

View File

@@ -13,12 +13,20 @@ type (
Description string `yaml:"description" json:"description"`
WidgetConfig map[string]any `yaml:",flow" json:"widget_config"`
SourceType string `yaml:"-" json:"source_type"`
Initialized bool `yaml:"-" json:"-"`
AltURL string `yaml:"-" json:"alt_url"` // original proxy target
SourceType string `yaml:"-" json:"source_type"`
AltURL string `yaml:"-" json:"alt_url"` // original proxy target
}
)
func (item *HomePageItem) IsEmpty() bool {
return item == nil || (item.Name == "" &&
item.Icon == "" &&
item.URL == "" &&
item.Category == "" &&
item.Description == "" &&
len(item.WidgetConfig) == 0)
}
func NewHomePageConfig() HomePageConfig {
return HomePageConfig(make(map[string]HomePageCategory))
}