Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve exporting HTML/Word

Daniel25f934ecb4c3
diff --git a/kernel/model/export.go b/kernel/model/export.go
index 1b2dbffba2..c0f963ae04 100644
--- a/kernel/model/export.go
+++ b/kernel/model/export.go
@@ -711,13 +711,12 @@ func ExportMarkdownHTML(id, savePath string, docx, merge bool) (name, dom string
}
}
- srcs := []string{"stage/build/export", "stage/build/fonts", "stage/protyle"}
+ srcs := []string{"stage/build/export", "stage/protyle"}
for _, src := range srcs {
from := filepath.Join(util.WorkingDir, src)
to := filepath.Join(savePath, src)
if err := filelock.Copy(from, to); err != nil {
logging.LogWarnf("copy stage from [%s] to [%s] failed: %s", from, savePath, err)
- return
}
}
@@ -869,7 +868,7 @@ func ExportHTML(id, savePath string, pdf, image, keepFold, merge bool) (name, do
}
if !pdf && "" != savePath { // 导出 HTML 需要复制静态资源
- srcs := []string{"stage/build/export", "stage/build/fonts", "stage/protyle"}
+ srcs := []string{"stage/build/export", "stage/protyle"}
for _, src := range srcs {
from := filepath.Join(util.WorkingDir, src)
to := filepath.Join(savePath, src)
@@ -899,7 +898,6 @@ func ExportHTML(id, savePath string, pdf, image, keepFold, merge bool) (name, do
to := filepath.Join(savePath, "appearance", src)
if err := filelock.Copy(from, to); err != nil {
logging.LogErrorf("copy appearance from [%s] to [%s] failed: %s", from, savePath, err)
- return
}
}
diff --git a/kernel/model/session.go b/kernel/model/session.go
index 46a8c1f7ec..3d8b7314f1 100644
--- a/kernel/model/session.go
+++ b/kernel/model/session.go
@@ -214,7 +214,6 @@ func CheckAuth(c *gin.Context) {
// 放过 /appearance/
if strings.HasPrefix(c.Request.RequestURI, "/appearance/") ||
strings.HasPrefix(c.Request.RequestURI, "/stage/build/export/") ||
- strings.HasPrefix(c.Request.RequestURI, "/stage/build/fonts/") ||
strings.HasPrefix(c.Request.RequestURI, "/stage/protyle/") {
c.Next()
return