From ef5a911f5760a374e7de0f16c19ba712184d9cad Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 5 Oct 2022 21:22:48 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E5=8F=8D=E9=93=BE=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E4=B8=AD=E6=96=87=E6=A1=A3=E6=A0=87=E9=A2=98=E5=9C=A8=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E6=82=AC=E6=B5=AE=E6=97=B6=E6=98=BE=E7=A4=BA=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E5=AE=8C=E6=95=B4=E8=B7=AF=E5=BE=84=20https://github.?= =?UTF-8?q?com/siyuan-note/insider/issues/1088?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/block.go | 1 + kernel/model/path.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/kernel/model/block.go b/kernel/model/block.go index 36455f39a..4ce27279c 100644 --- a/kernel/model/block.go +++ b/kernel/model/block.go @@ -69,6 +69,7 @@ type Path struct { ID string `json:"id"` // 块 ID Box string `json:"box"` // 块 Box Name string `json:"name"` // 当前路径 + HPath string `json:"hPath"` // 人类可读路径 Type string `json:"type"` // "path" NodeType string `json:"nodeType"` // 节点类型 SubType string `json:"subType"` // 节点子类型 diff --git a/kernel/model/path.go b/kernel/model/path.go index 7f3193e16..d3039ff6e 100644 --- a/kernel/model/path.go +++ b/kernel/model/path.go @@ -120,6 +120,10 @@ func toFlatTree(blocks []*Block, baseDepth int, typ string) (ret []*Path) { treeNode.Blocks = append(treeNode.Blocks, c) } ret = append(ret, treeNode) + + if "backlink" == typ { + treeNode.HPath = root.HPath + } } sort.Slice(ret, func(i, j int) bool {