improve path resolution stability

This commit is contained in:
Jacky Zhao 2023-08-19 16:28:44 -07:00
parent c874e7e937
commit dd47be1bc6
5 changed files with 8 additions and 7 deletions
quartz/plugins/transformers

View file

@ -60,7 +60,8 @@ export const CrawlLinks: QuartzTransformerPlugin<Partial<Options> | undefined> =
dest,
transformOptions,
)
const canonicalDest = path.posix.normalize(joinSegments(curSlug, dest))
const url = new URL(dest, `https://base.com/${curSlug}`)
const canonicalDest = url.pathname
const [destCanonical, _destAnchor] = splitAnchor(canonicalDest)
const simple = simplifySlug(destCanonical as FullSlug)
outgoing.add(simple)