mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-07 17:28:50 +01:00
🎨 改进集市已下载包更新 https://github.com/siyuan-note/siyuan/issues/5807
This commit is contained in:
parent
fcfbab3652
commit
9bc71a9f2c
15 changed files with 49 additions and 38 deletions
|
|
@ -126,6 +126,8 @@ func InstalledThemes() (ret []*Theme) {
|
|||
continue
|
||||
}
|
||||
|
||||
installPath := filepath.Join(util.ThemesPath, dirName)
|
||||
|
||||
theme := &Theme{}
|
||||
theme.Installed = true
|
||||
theme.Name = themeConf["name"].(string)
|
||||
|
|
@ -137,10 +139,11 @@ func InstalledThemes() (ret []*Theme) {
|
|||
theme.PreviewURL = "/appearance/themes/" + dirName + "/preview.png"
|
||||
theme.PreviewURLThumb = "/appearance/themes/" + dirName + "/preview.png"
|
||||
theme.Updated = themeDir.ModTime().Format("2006-01-02 15:04:05")
|
||||
theme.Size = themeDir.Size()
|
||||
theme.HSize = humanize.Bytes(uint64(theme.Size))
|
||||
theme.HUpdated = formatUpdated(theme.Updated)
|
||||
readme, readErr := os.ReadFile(filepath.Join(util.ThemesPath, dirName, "README.md"))
|
||||
installSize, _ := util.SizeOfDirectory(installPath)
|
||||
theme.InstallSize = installSize
|
||||
theme.HInstallSize = humanize.Bytes(uint64(installSize))
|
||||
readme, readErr := os.ReadFile(filepath.Join(installPath, "README.md"))
|
||||
if nil != readErr {
|
||||
logging.LogWarnf("read install theme README.md failed: %s", readErr)
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue