We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 597980f commit fe0fbeaCopy full SHA for fe0fbea
packages/astro/test/fixtures/astro-get-static-paths/src/pages/posts/[page].astro
@@ -1,5 +1,7 @@
1
---
2
-export async function getStaticPaths() {
+import type { GetStaticPaths, InferGetStaticParamsType } from "astro";
3
+
4
+export const getStaticPaths = (() => {
5
return [
6
{
7
params: { page: 1 },
@@ -11,9 +13,11 @@ export async function getStaticPaths() {
11
13
params: { page: 3 }
12
14
}
15
]
-};
16
+}) satisfies GetStaticPaths;
17
-const { page } = Astro.params
18
+type Params = InferGetStaticParamsType<typeof getStaticPaths>;
19
+const params = Astro.params as Params;
20
+const page = params.page satisfies string
21
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
22
23
0 commit comments