mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-19 02:21:38 +08:00
🎨 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
@ -77,6 +77,7 @@ type Package struct {
|
|||||||
Description *Description `json:"description"`
|
Description *Description `json:"description"`
|
||||||
Readme *Readme `json:"readme"`
|
Readme *Readme `json:"readme"`
|
||||||
Funding *Funding `json:"funding"`
|
Funding *Funding `json:"funding"`
|
||||||
|
Keywords []string `json:"keywords"`
|
||||||
|
|
||||||
PreferredFunding string `json:"preferredFunding"`
|
PreferredFunding string `json:"preferredFunding"`
|
||||||
PreferredName string `json:"preferredName"`
|
PreferredName string `json:"preferredName"`
|
||||||
|
@ -357,6 +357,12 @@ func matchPackage(keywords []string, pkg *bazaar.Package) bool {
|
|||||||
strings.Contains(strings.ToLower(pkg.Description.EnUS), keyword) {
|
strings.Contains(strings.ToLower(pkg.Description.EnUS), keyword) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, pkgKeyword := range pkg.Keywords {
|
||||||
|
if strings.Contains(strings.ToLower(pkgKeyword), keyword) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user