mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-07-03 14:09:06 +02:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
+1
-13
@@ -971,21 +971,9 @@ func getShorthandSavePath(c *gin.Context) {
|
||||
}
|
||||
|
||||
notebook := arg["notebook"].(string)
|
||||
box := model.Conf.Box(notebook)
|
||||
|
||||
var shorthandSaveBox string
|
||||
shorthandSaveBox := model.Conf.FileTree.ShorthandSaveBox
|
||||
shorthandSavePathTpl := model.Conf.FileTree.ShorthandSavePath
|
||||
if nil != box {
|
||||
boxConf := box.GetConf()
|
||||
shorthandSaveBox = boxConf.ShorthandSaveBox
|
||||
shorthandSavePathTpl = boxConf.ShorthandSavePath
|
||||
}
|
||||
if "" == shorthandSaveBox {
|
||||
shorthandSaveBox = model.Conf.FileTree.ShorthandSaveBox
|
||||
}
|
||||
if "" == shorthandSavePathTpl {
|
||||
shorthandSavePathTpl = model.Conf.FileTree.ShorthandSavePath
|
||||
}
|
||||
|
||||
if "" == shorthandSaveBox {
|
||||
shorthandSaveBox = notebook
|
||||
|
||||
@@ -411,13 +411,6 @@ func setNotebookConf(c *gin.Context) {
|
||||
|
||||
boxConf.DocCreateSavePath = util.TrimSpaceInPath(boxConf.DocCreateSavePath)
|
||||
|
||||
boxConf.ShorthandSavePath = util.TrimSpaceInPath(boxConf.ShorthandSavePath)
|
||||
if "" != boxConf.ShorthandSavePath {
|
||||
if !strings.HasPrefix(boxConf.ShorthandSavePath, "/") {
|
||||
boxConf.ShorthandSavePath = "/" + boxConf.ShorthandSavePath
|
||||
}
|
||||
}
|
||||
|
||||
box.SaveConf(boxConf)
|
||||
ret.Data = boxConf
|
||||
}
|
||||
|
||||
@@ -30,8 +30,6 @@ type BoxConf struct {
|
||||
DocCreateSavePath string `json:"docCreateSavePath"` // 新建文档存储路径
|
||||
DailyNoteSavePath string `json:"dailyNoteSavePath"` // 新建日记存储路径
|
||||
DailyNoteTemplatePath string `json:"dailyNoteTemplatePath"` // 新建日记使用的模板路径
|
||||
ShorthandSaveBox string `json:"shorthandSaveBox"` // 闪念速记存储笔记本
|
||||
ShorthandSavePath string `json:"shorthandSavePath"` // 闪念速记存储路径
|
||||
SortMode int `json:"sortMode"` // 排序方式
|
||||
}
|
||||
|
||||
|
||||
@@ -68,15 +68,7 @@ func MoveLocalShorthands(boxID string) (retIDs []string, err error) {
|
||||
}
|
||||
}
|
||||
|
||||
var hPath string
|
||||
box := Conf.Box(boxID)
|
||||
if nil != box {
|
||||
boxConf := box.GetConf()
|
||||
hPath = boxConf.ShorthandSavePath
|
||||
}
|
||||
if "" == hPath {
|
||||
hPath = Conf.FileTree.ShorthandSavePath
|
||||
}
|
||||
hPath := Conf.FileTree.ShorthandSavePath
|
||||
if "" != hPath {
|
||||
var renderErr error
|
||||
hPath, renderErr = RenderGoTemplate(hPath)
|
||||
@@ -202,6 +194,7 @@ func MoveLocalShorthands(boxID string) (retIDs []string, err error) {
|
||||
}
|
||||
|
||||
FlushTxQueue()
|
||||
box := Conf.Box(boxID)
|
||||
for _, id := range retIDs {
|
||||
b, _ := GetBlock(id, nil)
|
||||
PushCreate(box, b.Path, nil)
|
||||
|
||||
Reference in New Issue
Block a user