🎨 Add icon settings in marketplace package https://github.com/siyuan-note/siyuan/issues/8174

This commit is contained in:
Liang Ding 2023-05-05 15:46:09 +08:00
parent 93dad2bfb2
commit 897e98bd0d
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
6 changed files with 11 additions and 0 deletions

View file

@ -72,6 +72,7 @@ func Widgets() (widgets []*Widget) {
widget.RepoHash = repoURLHash[1]
widget.PreviewURL = util.BazaarOSSServer + "/package/" + repoURL + "/preview.png?imageslim"
widget.PreviewURLThumb = util.BazaarOSSServer + "/package/" + repoURL + "/preview.png?imageView2/2/w/436/h/232"
widget.IconURL = util.BazaarOSSServer + "/package/" + repoURL + "/icon.png"
widget.Updated = repo["updated"].(string)
widget.Stars = int(repo["stars"].(float64))
widget.OpenIssues = int(repo["openIssues"].(float64))
@ -136,6 +137,7 @@ func InstalledWidgets() (ret []*Widget) {
widget.RepoURL = widget.URL
widget.PreviewURL = "/widgets/" + dirName + "/preview.png"
widget.PreviewURLThumb = "/widgets/" + dirName + "/preview.png"
widget.IconURL = "/widgets/" + dirName + "/icon.png"
info, statErr := os.Stat(filepath.Join(installPath, "README.md"))
if nil != statErr {
logging.LogWarnf("stat install theme README.md failed: %s", statErr)