Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/13635#issuecomment-3794560233

Danielc1a6206f7be3
diff --git a/kernel/model/export.go b/kernel/model/export.go
index 06d8e34fbd..7d2cc21536 100644
--- a/kernel/model/export.go
+++ b/kernel/model/export.go
@@ -3411,6 +3411,11 @@ func exportPandocConvertZip(baseFolderName string, docPaths, defBlockIDs []strin
name = util.FilterFileName(name)
hPath = path.Join(dir, name)
p = hPath + ext
+ if 1 == len(docPaths) {
+ // 如果仅导出单个文档则使用文档标题作为文件名,不使用父路径 https://github.com/siyuan-note/siyuan/issues/13635#issuecomment-3794560233
+ p = name + ext
+ }
+
writePath := filepath.Join(exportFolder, p)
hash := fmt.Sprintf("%x", sha1.Sum([]byte(md)))
if gulu.File.IsExist(writePath) && hash != wrotePathHash[writePath] {