From 3c64778755725b6390e3b4b8fd831d7c972fc57c Mon Sep 17 00:00:00 2001 From: Igor Randjelovic Date: Thu, 3 Nov 2022 17:34:02 +0100 Subject: [PATCH] fix: case for home page/index page --- src/client/app/utils.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/client/app/utils.ts b/src/client/app/utils.ts index 028df61b659d..199eb970f083 100644 --- a/src/client/app/utils.ts +++ b/src/client/app/utils.ts @@ -28,6 +28,12 @@ export function pathToFile(path: string): string { pagePath = pagePath.slice(0, -1) } + // if we removed the trailing slash and have an empty page path + // we are trying to render the index/home page... + if (pagePath.length === 0) { + pagePath = '/index' + } + if (import.meta.env.DEV) { // always force re-fetch content in dev pagePath += `.md?t=${Date.now()}`