summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/astro/src/build/page.ts5
-rw-r--r--packages/astro/test/astro-pages.test.js2
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<void> {
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);