🎨 Improve exporting HTML/Word
This commit is contained in:
parent
b195629d1a
commit
25f934ecb4
2 changed files with 2 additions and 5 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue