mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-02 14:58:14 +00:00
fix: links to index not showing in graph (closes #450)
This commit is contained in:
parent
828aa71fe3
commit
2525bfbab5
3 changed files with 3 additions and 2 deletions
quartz/components/scripts
|
@ -47,11 +47,12 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
|
|||
const data = await fetchData
|
||||
|
||||
const links: LinkData[] = []
|
||||
const validLinks = new Set(Object.keys(data).map((slug) => simplifySlug(slug as FullSlug)))
|
||||
for (const [src, details] of Object.entries<ContentDetails>(data)) {
|
||||
const source = simplifySlug(src as FullSlug)
|
||||
const outgoing = details.links ?? []
|
||||
for (const dest of outgoing) {
|
||||
if (dest in data) {
|
||||
if (validLinks.has(dest)) {
|
||||
links.push({ source, target: dest })
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue