From 0f598008d7230137506ace853fc0246ad7ea256d Mon Sep 17 00:00:00 2001 From: "Yousef M. El-Gohary" <30435916+yousefelgoharyx@users.noreply.github.com> Date: Sat, 10 Sep 2022 16:01:27 +0200 Subject: [PATCH] Paths on windows (#5036) * add loading indicator to sidebar links * replace backslashes with slashes * bumping DISK_CACHE_BREAKER * using replace instead or replaceAll --- beta/src/pages/[[...markdownPath]].js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beta/src/pages/[[...markdownPath]].js b/beta/src/pages/[[...markdownPath]].js index e1dff3fe..d9c3063f 100644 --- a/beta/src/pages/[[...markdownPath]].js +++ b/beta/src/pages/[[...markdownPath]].js @@ -55,7 +55,7 @@ function reviveNodeOnClient(key, val) { // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~ IMPORTANT: BUMP THIS IF YOU CHANGE ANY CODE BELOW ~~~ -const DISK_CACHE_BREAKER = 2; +const DISK_CACHE_BREAKER = 3; // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Put MDX output into JSON for client. @@ -207,7 +207,7 @@ export async function getStaticPaths() { // 'foo/bar/baz.md' -> ['foo', 'bar', 'baz'] // 'foo/bar/qux/index.md' -> ['foo', 'bar', 'qux'] function getSegments(file) { - let segments = file.slice(0, -3).split('/'); + let segments = file.slice(0, -3).replace(/\\/g, '/').split('/'); if (segments[segments.length - 1] === 'index') { segments.pop(); }