From 288dfa4e3c860c909240036ceb5fcc9596682689 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Sat, 25 Jun 2022 22:53:59 +0530 Subject: [PATCH] fix: #412 --- src/client/app/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/app/utils.ts b/src/client/app/utils.ts index 4879f7ab..91b8da5b 100644 --- a/src/client/app/utils.ts +++ b/src/client/app/utils.ts @@ -35,7 +35,8 @@ export function pathToFile(path: string): string { // /foo/bar.html -> ./foo_bar.md if (inBrowser) { const base = import.meta.env.BASE_URL - pagePath = pagePath.slice(base.length).replace(/\//g, '_') + '.md' + pagePath = + (pagePath.slice(base.length).replace(/\//g, '_') || 'index') + '.md' // client production build needs to account for page hash, which is // injected directly in the page's html const pageHash = __VP_HASH_MAP__[pagePath.toLowerCase()]