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()]