mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-04 01:09:31 +08:00
This commit is contained in:
parent
17595a3076
commit
efefa9baaf
@ -90,7 +90,7 @@ func getBacklink(c *gin.Context) {
|
|||||||
keyword := arg["k"].(string)
|
keyword := arg["k"].(string)
|
||||||
mentionKeyword := arg["mk"].(string)
|
mentionKeyword := arg["mk"].(string)
|
||||||
beforeLen := arg["beforeLen"].(float64)
|
beforeLen := arg["beforeLen"].(float64)
|
||||||
boxID, backlinks, backmentions, linkRefsCount, mentionsCount := model.BuildTreeBacklink(id, keyword, mentionKeyword, int(beforeLen))
|
boxID, backlinks, backmentions, linkRefsCount, mentionsCount := model.GetBacklink(id, keyword, mentionKeyword, int(beforeLen))
|
||||||
ret.Data = map[string]interface{}{
|
ret.Data = map[string]interface{}{
|
||||||
"backlinks": backlinks,
|
"backlinks": backlinks,
|
||||||
"linkRefsCount": linkRefsCount,
|
"linkRefsCount": linkRefsCount,
|
||||||
|
@ -297,7 +297,7 @@ func buildBacklink(refID string, refTree *parse.Tree, luteEngine *lute.Lute) (re
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func BuildTreeBacklink(id, keyword, mentionKeyword string, beforeLen int) (boxID string, backlinks, backmentions []*Path, linkRefsCount, mentionsCount int) {
|
func GetBacklink(id, keyword, mentionKeyword string, beforeLen int) (boxID string, backlinks, backmentions []*Path, linkRefsCount, mentionsCount int) {
|
||||||
keyword = strings.TrimSpace(keyword)
|
keyword = strings.TrimSpace(keyword)
|
||||||
mentionKeyword = strings.TrimSpace(mentionKeyword)
|
mentionKeyword = strings.TrimSpace(mentionKeyword)
|
||||||
backlinks, backmentions = []*Path{}, []*Path{}
|
backlinks, backmentions = []*Path{}, []*Path{}
|
||||||
|
Loading…
Reference in New Issue
Block a user