mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02: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
2 changed files with 7 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue