diff --git a/app/appearance/icons/ant/icon.js b/app/appearance/icons/ant/icon.js deleted file mode 100644 index e82b96cea..000000000 --- a/app/appearance/icons/ant/icon.js +++ /dev/null @@ -1,638 +0,0 @@ -document.body.insertAdjacentHTML('afterbegin', ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`) diff --git a/app/appearance/icons/ant/icon.json b/app/appearance/icons/ant/icon.json deleted file mode 100644 index 17d7def66..000000000 --- a/app/appearance/icons/ant/icon.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "ant", - "author": "Vanessa", - "url": "https://github.com/Vanessa219", - "version": "1.36.0" -} diff --git a/app/src/protyle/export/index.ts b/app/src/protyle/export/index.ts index d15da9c61..af5f81f85 100644 --- a/app/src/protyle/export/index.ts +++ b/app/src/protyle/export/index.ts @@ -25,7 +25,7 @@ const getPluginStyle = async () => { }; const getIconScript = (servePath: string) => { - const isBuiltInIcon = ["ant", "material"].includes(window.siyuan.config.appearance.icon); + const isBuiltInIcon = ["material"].includes(window.siyuan.config.appearance.icon); const html = isBuiltInIcon ? "" : ``; return html + ``; }; diff --git a/app/src/util/assets.ts b/app/src/util/assets.ts index 12058c50b..48324ab36 100644 --- a/app/src/util/assets.ts +++ b/app/src/util/assets.ts @@ -109,7 +109,7 @@ export const loadAssets = (data: Config.IAppearance) => { } // load icons - const isBuiltInIcon = ["ant", "material"].includes(data.icon); + const isBuiltInIcon = ["material"].includes(data.icon); const iconScriptElement = document.getElementById("iconScript"); const iconDefaultScriptElement = document.getElementById("iconDefaultScript"); // 不能使用 data.iconVer,因为其他主题也需要加载默认图标,此时 data.iconVer 为其他图标的版本号 diff --git a/kernel/model/bazaar.go b/kernel/model/bazaar.go index 9729936c8..3098ecdc0 100644 --- a/kernel/model/bazaar.go +++ b/kernel/model/bazaar.go @@ -416,5 +416,5 @@ func isBuiltInTheme(name string) bool { // isBuiltInIcon 通过包名或目录名判断是否为内置图标 func isBuiltInIcon(name string) bool { - return "ant" == name || "material" == name + return "material" == name } diff --git a/kernel/model/conf.go b/kernel/model/conf.go index 3f61155ab..0f21bdf47 100644 --- a/kernel/model/conf.go +++ b/kernel/model/conf.go @@ -197,6 +197,10 @@ func InitConf() { util.Lang = Conf.Lang } Conf.Appearance.Lang = Conf.Lang + if "ant" == Conf.Appearance.Icon { + // v3.6.6 移除了 ant 图标包,如果用户之前选择了 ant 图标包,升级后改为 material 图标包,避免图标显示异常 https://github.com/siyuan-note/siyuan/issues/7976 + Conf.Appearance.Icon = "material" + } if nil == Conf.UILayout { Conf.UILayout = &conf.UILayout{} } diff --git a/kernel/model/export.go b/kernel/model/export.go index 5da2bfb97..20eae09ca 100644 --- a/kernel/model/export.go +++ b/kernel/model/export.go @@ -933,8 +933,8 @@ func ExportMarkdownHTML(id, savePath string, docx, merge bool) (name, dom string // 只复制图标文件夹中的 icon.js 文件 iconName := Conf.Appearance.Icon - // 如果使用的不是内建图标(ant 或 material),需要复制 material 作为后备 - if iconName != "ant" && iconName != "material" && iconName != "" { + // 如果使用的不是内建图标(material),需要复制 material 作为后备 + if iconName != "material" && iconName != "" { srcIconFile := filepath.Join(appearancePath, "icons", "material", "icon.js") toIconDir := filepath.Join(savePath, "appearance", "icons", "material") if err := os.MkdirAll(toIconDir, 0755); err != nil { @@ -1130,8 +1130,8 @@ func ExportHTML(id, savePath string, pdf, keepFold, merge bool) (name, dom strin // 只复制图标文件夹中的 icon.js 文件 iconName := Conf.Appearance.Icon - // 如果使用的不是内建图标(ant 或 material),需要复制 material 作为后备 - if iconName != "ant" && iconName != "material" && iconName != "" { + // 如果使用的不是内建图标(material),需要复制 material 作为后备 + if iconName != "material" && iconName != "" { srcIconFile := filepath.Join(appearancePath, "icons", "material", "icon.js") toIconDir := filepath.Join(savePath, "appearance", "icons", "material") if err := os.MkdirAll(toIconDir, 0755); err != nil {