🎨 Add the keywords
field to the marketplace package conf JSON https://github.com/siyuan-note/siyuan/issues/9499
This commit is contained in:
parent
39a912c66e
commit
2f8ab890fb
2 changed files with 7 additions and 0 deletions
|
@ -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"`
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue