From bf29561686f6d2c742f1a81323977441675e346e Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 24 Mar 2023 20:53:47 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E9=9B=86=E5=B8=82=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=B8=8D=E5=90=8C=E6=AD=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20Fix=20https://github.com/siyuan-note/siyuan/issues/?= =?UTF-8?q?7775?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/bazaar/icon.go | 2 ++ kernel/bazaar/template.go | 2 ++ kernel/bazaar/theme.go | 2 ++ kernel/bazaar/widget.go | 2 ++ 4 files changed, 8 insertions(+) diff --git a/kernel/bazaar/icon.go b/kernel/bazaar/icon.go index a7d204639..dc29afc4e 100644 --- a/kernel/bazaar/icon.go +++ b/kernel/bazaar/icon.go @@ -63,6 +63,7 @@ func Icons() (icons []*Icon) { logging.LogErrorf("get bazaar package [%s] failed: %d", innerU, innerResp.StatusCode) return } + icon.URL = strings.TrimSuffix(icon.URL, "/") repoURLHash := strings.Split(repoURL, "@") icon.RepoURL = "https://github.com/" + repoURLHash[0] @@ -125,6 +126,7 @@ func InstalledIcons() (ret []*Icon) { icon.Name = iconConf["name"].(string) icon.Author = iconConf["author"].(string) icon.URL = iconConf["url"].(string) + icon.URL = strings.TrimSuffix(icon.URL, "/") icon.Version = iconConf["version"].(string) icon.RepoURL = icon.URL icon.PreviewURL = "/appearance/icons/" + dirName + "/preview.png" diff --git a/kernel/bazaar/template.go b/kernel/bazaar/template.go index 53b72f281..187226acd 100644 --- a/kernel/bazaar/template.go +++ b/kernel/bazaar/template.go @@ -64,6 +64,7 @@ func Templates() (templates []*Template) { logging.LogErrorf("get bazaar package [%s] failed: %d", innerU, innerResp.StatusCode) return } + template.URL = strings.TrimSuffix(template.URL, "/") repoURLHash := strings.Split(repoURL, "@") template.RepoURL = "https://github.com/" + repoURLHash[0] @@ -125,6 +126,7 @@ func InstalledTemplates() (ret []*Template) { template.Name = templateConf["name"].(string) template.Author = templateConf["author"].(string) template.URL = templateConf["url"].(string) + template.URL = strings.TrimSuffix(template.URL, "/") template.Version = templateConf["version"].(string) template.RepoURL = template.URL template.PreviewURL = "/templates/" + dirName + "/preview.png" diff --git a/kernel/bazaar/theme.go b/kernel/bazaar/theme.go index c6aeca0c5..7ff4a7363 100644 --- a/kernel/bazaar/theme.go +++ b/kernel/bazaar/theme.go @@ -65,6 +65,7 @@ func Themes() (ret []*Theme) { logging.LogErrorf("get bazaar package [%s] failed: %d", innerU, innerResp.StatusCode) return } + theme.URL = strings.TrimSuffix(theme.URL, "/") repoURLHash := strings.Split(repoURL, "@") theme.RepoURL = "https://github.com/" + repoURLHash[0] @@ -127,6 +128,7 @@ func InstalledThemes() (ret []*Theme) { theme.Name = themeConf["name"].(string) theme.Author = themeConf["author"].(string) theme.URL = themeConf["url"].(string) + theme.URL = strings.TrimSuffix(theme.URL, "/") theme.Version = themeConf["version"].(string) for _, mode := range themeConf["modes"].([]interface{}) { theme.Modes = append(theme.Modes, mode.(string)) diff --git a/kernel/bazaar/widget.go b/kernel/bazaar/widget.go index b90cf200f..262693c9a 100644 --- a/kernel/bazaar/widget.go +++ b/kernel/bazaar/widget.go @@ -64,6 +64,7 @@ func Widgets() (widgets []*Widget) { logging.LogErrorf("get bazaar package [%s] failed: %d", innerU, innerResp.StatusCode) return } + widget.URL = strings.TrimSuffix(widget.URL, "/") repoURLHash := strings.Split(repoURL, "@") widget.RepoURL = "https://github.com/" + repoURLHash[0] @@ -123,6 +124,7 @@ func InstalledWidgets() (ret []*Widget) { widget.Name = widgetConf["name"].(string) widget.Author = widgetConf["author"].(string) widget.URL = widgetConf["url"].(string) + widget.URL = strings.TrimSuffix(widget.URL, "/") widget.Version = widgetConf["version"].(string) widget.RepoURL = widget.URL widget.PreviewURL = "/widgets/" + dirName + "/preview.png"