diff --git a/sites/example-project/src/pages/api/pagesManifest.json/+server.js b/sites/example-project/src/pages/api/pagesManifest.json/+server.js index 82ef85c172..22a5b58b55 100644 --- a/sites/example-project/src/pages/api/pagesManifest.json/+server.js +++ b/sites/example-project/src/pages/api/pagesManifest.json/+server.js @@ -27,7 +27,7 @@ export function _buildPageManifest(pages) { isPage: false }; for (const [pagePath, pageContent] of Object.entries(pages)) { - const path = pagePath.replace('src/pages/', ''); + const path = pagePath.replace('/src/pages/', ''); let node = fileTree; for (const part of path.split('/')) { if (part === '+page.md') { @@ -71,7 +71,7 @@ export async function GET() { const relative_path = path.join(dirent.parentPath ?? dirent.path ?? dir, dirent.name); const content = await fs.readFile(relative_path, 'utf-8'); // regularize for windows - const normalized_path = path.normalize(relative_path).replace('\\', '/'); + const normalized_path = path.normalize(relative_path).split(path.sep).join('/'); pages[normalized_path] = content; } else if (dirent.isDirectory()) { await recursiveReadDir(path.join(dir, dirent.name));