Jacky Zhao
2023-09-07 2525bfbab5553f970997ea3c60af180cbef1fdd2
fix: links to index not showing in graph (closes #450)
3 files modified
5 ■■■■■ changed files
quartz/build.ts 1 ●●●● patch | view | raw | blame | history
quartz/components/scripts/graph.inline.ts 3 ●●●● patch | view | raw | blame | history
quartz/plugins/transformers/links.ts 1 ●●●● patch | view | raw | blame | history
quartz/build.ts
@@ -142,6 +142,7 @@
      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)
quartz/components/scripts/graph.inline.ts
@@ -47,11 +47,12 @@
  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 })
      }
    }
quartz/plugins/transformers/links.ts
@@ -5,7 +5,6 @@
  SimpleSlug,
  TransformOptions,
  _stripSlashes,
  joinSegments,
  simplifySlug,
  splitAnchor,
  transformLink,