Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/little-sheep-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': minor
---

Add `routePattern` to `GetStaticPathsOptions`
1 change: 1 addition & 0 deletions packages/astro/src/core/render/route-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export async function callGetStaticPaths({
// Q: Why the cast?
// A: So users downstream can have nicer typings, we have to make some sacrifice in our internal typings, which necessitate a cast here
paginate: generatePaginateFunction(route, base) as PaginateFunction,
routePattern: route.route,
});

validateGetStaticPathsResult(staticPaths, logger, route);
Expand Down
1 change: 1 addition & 0 deletions packages/astro/src/types/public/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type { APIContext } from './context.js';
*/
export interface GetStaticPathsOptions {
paginate: PaginateFunction;
routePattern: string;
}

export type GetStaticPathsItem = {
Expand Down
Loading