diff options
author | 2021-07-20 01:42:33 +0000 | |
---|---|---|
committer | 2021-07-20 01:42:33 +0000 | |
commit | 31533069533f397142aa961d326ed80df1a13e8c (patch) | |
tree | 142717d5a6e0cf9ef6654deb0c19b4d18e252d43 | |
parent | 40c882a2536c2de2f566fc8f09aeaa0dad90d404 (diff) | |
download | astro-31533069533f397142aa961d326ed80df1a13e8c.tar.gz astro-31533069533f397142aa961d326ed80df1a13e8c.tar.zst astro-31533069533f397142aa961d326ed80df1a13e8c.zip |
[ci] yarn format
-rw-r--r-- | packages/astro/src/build/page.ts | 5 | ||||
-rw-r--r-- | 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<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); |