🎨 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

@ -73,6 +73,7 @@ func Themes() (ret []*Theme) {
theme.RepoHash = repoURLHash[1]
theme.PreviewURL = util.BazaarOSSServer + "/package/" + repoURL + "/preview.png?imageslim"
theme.PreviewURLThumb = util.BazaarOSSServer + "/package/" + repoURL + "/preview.png?imageView2/2/w/436/h/232"
theme.IconURL = util.BazaarOSSServer + "/package/" + repoURL + "/icon.png"
theme.Updated = repo["updated"].(string)
theme.Stars = int(repo["stars"].(float64))
theme.OpenIssues = int(repo["openIssues"].(float64))
@ -142,6 +143,7 @@ func InstalledThemes() (ret []*Theme) {
theme.RepoURL = theme.URL
theme.PreviewURL = "/appearance/themes/" + dirName + "/preview.png"
theme.PreviewURLThumb = "/appearance/themes/" + dirName + "/preview.png"
theme.IconURL = "/appearance/themes/" + 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)