🎨 Add the keywords field to the marketplace package conf JSON https://github.com/siyuan-note/siyuan/issues/9499

This commit is contained in:
Daniel 2023-10-25 16:08:59 +08:00
parent 39a912c66e
commit 2f8ab890fb
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 7 additions and 0 deletions

View file

@ -77,6 +77,7 @@ type Package struct {
Description *Description `json:"description"`
Readme *Readme `json:"readme"`
Funding *Funding `json:"funding"`
Keywords []string `json:"keywords"`
PreferredFunding string `json:"preferredFunding"`
PreferredName string `json:"preferredName"`

View file

@ -357,6 +357,12 @@ func matchPackage(keywords []string, pkg *bazaar.Package) bool {
strings.Contains(strings.ToLower(pkg.Description.EnUS), keyword) {
return true
}
for _, pkgKeyword := range pkg.Keywords {
if strings.Contains(strings.ToLower(pkgKeyword), keyword) {
return true
}
}
}
return false
}