This commit is contained in:
Liang Ding 2022-09-04 00:06:45 +08:00
parent 9bc71a9f2c
commit 3bb1427492
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
12 changed files with 32 additions and 9 deletions

View file

@ -135,8 +135,12 @@ func InstalledTemplates() (ret []*Template) {
template.RepoURL = template.URL
template.PreviewURL = "/templates/" + dirName + "/preview.png"
template.PreviewURLThumb = "/templates/" + dirName + "/preview.png"
template.Updated = templateDir.ModTime().Format("2006-01-02 15:04:05")
template.HUpdated = formatUpdated(template.Updated)
info, statErr := os.Stat(filepath.Join(installPath, "README.md"))
if nil != statErr {
logging.LogWarnf("stat install theme README.md failed: %s", statErr)
continue
}
template.HInstallDate = info.ModTime().Format("2006-01-02")
installSize, _ := util.SizeOfDirectory(installPath)
template.InstallSize = installSize
template.HInstallSize = humanize.Bytes(uint64(installSize))