Skip to content

Commit

Permalink
回滚旧版主题 theme.js #727
Browse files Browse the repository at this point in the history
  • Loading branch information
Soltus committed May 21, 2024
1 parent 695c043 commit 666f68e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .vscode/Sillot.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
"path": "../../sofillBuilder", // 沁棘开发仓库(暂未开源)
"name": "沁棘🤍../sofillBuilder 🗂️"
},
{
"path": "../../winsaybuilder", // 沁棘开发仓库(暂未开源)
"name": "风颂🤍../winsaybuilder 🗂️"
},
{
"path": "../_sili", // 列出子文件夹,在父文件夹的 setting.json 添加隐藏(排除)
"name": "司丽🤍/_sili 🗂️"
Expand Down
2 changes: 1 addition & 1 deletion app/src/util/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const loadAssets = (data: Config.IAppearance) => {
setCodeTheme();

const themeScriptElement = document.getElementById("themeScript");
const themeScriptAddress = `/appearance/themes/${data.mode === 1 ? data.themeDark : data.themeLight}/____/__js__.js?v=${data.themeVer}`;
const themeScriptAddress = `/appearance/themes/${data.mode === 1 ? data.themeDark : data.themeLight}/theme.js?v=${data.themeVer}`;
if (themeScriptElement) {
// https://github.com/siyuan-note/siyuan/issues/10341
themeScriptElement.remove();
Expand Down
2 changes: 1 addition & 1 deletion kernel/server/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func serveAppearance(ginServer *gin.Engine) {
}
siyuan.GET("/appearance/*filepath", func(c *gin.Context) {
filePath := filepath.Join(appearancePath, strings.TrimPrefix(c.Request.URL.Path, "/appearance/"))
if strings.HasSuffix(c.Request.URL.Path, "/____/__js__.js") {
if strings.HasSuffix(c.Request.URL.Path, "/theme.js") {
if !gulu.File.IsExist(filePath) {
// 主题 js 不存在时生成空内容返回
c.Data(200, "application/x-javascript", nil)
Expand Down

0 comments on commit 666f68e

Please sign in to comment.