Fix path prefix handling for "/"

Signed-off-by: Julius Volz <julius.volz@gmail.com>
pull/14448/head
Julius Volz 9 months ago
parent 143917cfe0
commit dee41028f7

@ -162,10 +162,7 @@ const getPathPrefix = (path: string) => {
} }
const pagePath = allPages.find((p) => path.endsWith(p.path))?.path; const pagePath = allPages.find((p) => path.endsWith(p.path))?.path;
if (pagePath === undefined) { return path.slice(0, path.length - (pagePath || "").length);
throw new Error(`Could not find base path for ${path}`);
}
return path.slice(0, path.length - pagePath.length);
}; };
const navLinkXPadding = "md"; const navLinkXPadding = "md";

Loading…
Cancel
Save