1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-12 05:20:26 +00:00

Make backlink sidebar invisible and make backlink indexer sync

This commit is contained in:
bouncepaw 2021-02-20 21:23:47 +05:00
parent c726a8b307
commit 9f1eadcec4
3 changed files with 9 additions and 16 deletions

View File

@ -3,7 +3,6 @@ package shroom
import (
"io/ioutil"
"log"
"sync"
"github.com/bouncepaw/mycorrhiza/hyphae"
"github.com/bouncepaw/mycorrhiza/markup"
@ -18,25 +17,19 @@ func FindAllBacklinks() {
func findBacklinkWorker(h *hyphae.Hypha) {
var (
wg sync.WaitGroup
textContents, err = ioutil.ReadFile(h.TextPath)
)
if err == nil {
for outlink := range markup.Doc(h.Name, string(textContents)).OutLinks() {
go func() {
wg.Add(1)
outlinkHypha := hyphae.ByName(outlink)
if outlinkHypha == h {
return
}
outlinkHypha := hyphae.ByName(outlink)
if outlinkHypha == h {
break
}
outlinkHypha.AddBackLink(h)
outlinkHypha.InsertIfNewKeepExistence()
h.AddOutLink(outlinkHypha)
wg.Done()
}()
outlinkHypha.AddBackLink(h)
outlinkHypha.InsertIfNewKeepExistence()
h.AddOutLink(outlinkHypha)
}
wg.Wait()
} else {
log.Println("Error when reading text contents of %s: %s", h.Name, err.Error())
}

View File

@ -280,7 +280,7 @@ mark { background: rgba(130, 80, 30, 5); color: inherit; }
}
.backlinks { display: none; }
`)
//line templates/asset.qtpl:2
qw422016.N().S(`

View File

@ -255,4 +255,4 @@ mark { background: rgba(130, 80, 30, 5); color: inherit; }
}
.backlinks { display: none; }