1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-12-03 23:28:05 +00:00

Add backlinks counter

This commit is contained in:
Mikhail Chekan
2021-09-01 03:39:33 +08:00
committed by Timur Ismagilov
parent 7c41403eee
commit b469b8f57d
3 changed files with 132 additions and 100 deletions

View File

@@ -52,6 +52,13 @@ func IndexBacklinks() {
}
}
func BacklinksCount(h *Hypha) int {
if _, exists := backlinkIndex[h.Name]; exists {
return len(backlinkIndex[h.Name])
}
return 0
}
func BacklinksOnEdit(h *Hypha, oldText string) {
backlinkIndexMutex.Lock()
newLinks := toLinkSet(ExtractHyphaLinks(h))