fix: links to index not showing in graph (closes )

This commit is contained in:
Jacky Zhao 2023-09-06 22:24:15 -07:00
parent 828aa71fe3
commit 2525bfbab5
3 changed files with 3 additions and 2 deletions
quartz/components/scripts

View file

@ -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 })
}
}