From 7eafbf0171317957fbb091d8f62c3c7d029c34fb Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 21 Sep 2022 19:59:32 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20`/=E6=A8=A1=E6=9D=BF`=20=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=8C=89=E5=90=8D=E7=A7=B0=E8=87=AA=E7=84=B6=E5=8D=87?= =?UTF-8?q?=E5=BA=8F=E6=8E=92=E5=BA=8F=20Fix=20https://github.com/siyuan-n?= =?UTF-8?q?ote/siyuan/issues/5916?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/template.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/model/template.go b/kernel/model/template.go index bfcec3563..c30e094bd 100644 --- a/kernel/model/template.go +++ b/kernel/model/template.go @@ -23,6 +23,7 @@ import ( "io/fs" "os" "path/filepath" + "sort" "strings" "text/template" "time" @@ -88,6 +89,7 @@ func SearchTemplate(keyword string) (ret []*Block) { } return nil }) + sort.Slice(ret, func(i, j int) bool { return util.PinYinCompare(filepath.Base(ret[i].Path), filepath.Base(ret[j].Path)) }) return }