From 45205c5e2fb1012bb2dbbf81e06556a189c0bbb3 Mon Sep 17 00:00:00 2001 From: Martin Trapp <94928215+martrapp@users.noreply.github.com> Date: Wed, 10 Jun 2026 17:22:28 +0200 Subject: [PATCH] fix: update pathToPageUrl function to ensure correct URL formatting --- bin/chunk-docs.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/chunk-docs.ts b/bin/chunk-docs.ts index 883a325..34f9470 100644 --- a/bin/chunk-docs.ts +++ b/bin/chunk-docs.ts @@ -188,15 +188,14 @@ function toMarkdownLink(label: string, target: string): string { } function pathToPageUrl(filePath: string): string { - const rel = path.relative(DOCS_DIR, filePath).replace(/\\/g, '/'); + const rel = "/" + path.relative(DOCS_DIR, filePath).replace(/\\/g, '/'); const noExt = rel.replace(/\.(mdx|md)$/i, ''); const route = noExt.replace(/\/index$/i, ''); - if (!route) return `${SITE_URL}/`; - return `${SITE_URL}/${route}/`; + return `${SITE_URL}${route}/`; } function pathToDocStem(filePath: string): string { - const rel = path.relative(DOCS_DIR, filePath).replace(/\\/g, '/'); + const rel = "/" + path.relative(DOCS_DIR, filePath).replace(/\\/g, '/'); const noExt = rel.replace(/\.(mdx|md)$/i, ''); return noExt.replace(/\/index$/i, '') || 'index'; } -- knotmirror 0.0.1