From 42bdb5d0eb4b62407d2a5a89fdf60c549fb906b2 Mon Sep 17 00:00:00 2001 From: saberzero1 Date: Fri, 22 May 2026 02:51:18 +0200 Subject: [PATCH] fix: add frontmatter links to the existing links set --- src/transformer.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/transformer.ts b/src/transformer.ts index 3df8a6a..3184b0b 100644 --- a/src/transformer.ts +++ b/src/transformer.ts @@ -170,6 +170,19 @@ export const CrawlLinks: QuartzTransformerPlugin> = ( } }); + const frontmatterLinks = (file.data.frontmatterLinks as string[] | undefined) ?? []; + for (const fmLink of frontmatterLinks) { + const [targetRaw] = splitAnchor(fmLink); + if (!targetRaw) continue; + const dest = transformLink(fileSlug, targetRaw, transformOptions); + const url = new URL(dest, "https://base.com/" + stripSlashes(curSlug, true)); + const [canonicalRaw] = splitAnchor(url.pathname); + let canonical = canonicalRaw; + if (canonical.endsWith("/")) canonical += "index"; + const full = decodeURIComponent(stripSlashes(canonical, true)) as FullSlug; + outgoing.add(simplifySlug(full)); + } + file.data.links = [...outgoing]; }; },