This commit is contained in:
Liang Ding 2023-05-05 22:00:51 +08:00
parent e1edc4684e
commit b7ae8295a5
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
6 changed files with 66 additions and 8 deletions

View file

@ -73,6 +73,8 @@ func Templates() (templates []*Template) {
template.PreviewURL = util.BazaarOSSServer + "/package/" + repoURL + "/preview.png?imageslim"
template.PreviewURLThumb = util.BazaarOSSServer + "/package/" + repoURL + "/preview.png?imageView2/2/w/436/h/232"
template.IconURL = util.BazaarOSSServer + "/package/" + repoURL + "/icon.png"
template.Funding = parseFunding(repo["package"].(map[string]interface{}))
template.PreferredFunding = getPreferredFunding(template.Funding)
template.Updated = repo["updated"].(string)
template.Stars = int(repo["stars"].(float64))
template.OpenIssues = int(repo["openIssues"].(float64))
@ -141,6 +143,7 @@ func InstalledTemplates() (ret []*Template) {
template.PreviewURLThumb = "/templates/" + dirName + "/preview.png"
template.IconURL = "/templates/" + dirName + "/icon.png"
template.Funding = parseFunding(templateConf)
template.PreferredFunding = getPreferredFunding(template.Funding)
info, statErr := os.Stat(filepath.Join(installPath, "README.md"))
if nil != statErr {
logging.LogWarnf("stat install theme README.md failed: %s", statErr)