fix: links to index not showing in graph (closes #450)
| | |
| | | |
| | | const parsedFiles = [...contentMap.values()] |
| | | const filteredContent = filterContent(ctx, parsedFiles) |
| | | |
| | | // TODO: we can probably traverse the link graph to figure out what's safe to delete here |
| | | // instead of just deleting everything |
| | | await rimraf(argv.output) |
| | |
| | | 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 }) |
| | | } |
| | | } |
| | |
| | | SimpleSlug, |
| | | TransformOptions, |
| | | _stripSlashes, |
| | | joinSegments, |
| | | simplifySlug, |
| | | splitAnchor, |
| | | transformLink, |