From 31533069533f397142aa961d326ed80df1a13e8c Mon Sep 17 00:00:00 2001 From: FredKSchott Date: Tue, 20 Jul 2021 01:42:33 +0000 Subject: [PATCH] [ci] yarn format --- packages/astro/src/build/page.ts | 5 ++++- packages/astro/test/astro-pages.test.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/astro/src/build/page.ts b/packages/astro/src/build/page.ts index a03fee5de..b0b56ba37 100644 --- a/packages/astro/src/build/page.ts +++ b/packages/astro/src/build/page.ts @@ -91,7 +91,10 @@ export async function buildCollectionPage({ astroConfig, filepath, runtime, site /** Build static page */ export async function buildStaticPage({ astroConfig, buildState, filepath, runtime }: PageBuildOptions): Promise { const { pages: pagesRoot } = astroConfig; - const url = filepath.pathname.replace(pagesRoot.pathname, '/').replace(/.(astro|md)$/, '').replace(/\/index$/, '/'); + const url = filepath.pathname + .replace(pagesRoot.pathname, '/') + .replace(/.(astro|md)$/, '') + .replace(/\/index$/, '/'); const result = await runtime.load(url); if (result.statusCode !== 200) { let err = (result as any).error; diff --git a/packages/astro/test/astro-pages.test.js b/packages/astro/test/astro-pages.test.js index 729f17513..04f10c745 100644 --- a/packages/astro/test/astro-pages.test.js +++ b/packages/astro/test/astro-pages.test.js @@ -12,7 +12,7 @@ Pages('Can find page with "index" at the end file name', async ({ build, runtime await build().catch((err) => { assert.ok(!err, 'Error during the build'); }); - + const result = await runtime.load('posts/name-with-index'); if (result.error) throw new Error(result.error);