Skip to content

Commit fe841a1

Browse files
committed
[Portal] Fix reference page static generation
1 parent d665684 commit fe841a1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

apps/portal/src/app/references/components/TDoc/PageLayout.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ import { getSidebarLinkGroups } from "./utils/getSidebarLinkgroups";
2020
import { fetchAllSlugs, getSlugToDocMap } from "./utils/slugs";
2121
import { nameToSubgroupSlug, subgroups } from "./utils/subgroups";
2222

23-
type PageProps = { params: Promise<{ version: string; slug?: string[] }> };
23+
type PageProps = {
24+
params: Promise<{ version: string; slug?: string[] }>;
25+
};
26+
2427
type LayoutProps = {
2528
params: Promise<{ version: string }>;
2629
children: React.ReactNode;
@@ -100,7 +103,9 @@ export function getTDocPage(options: {
100103
}
101104

102105
// statically generate pages for latest version
103-
async function generateStaticParams(): Promise<PageProps["params"][]> {
106+
async function generateStaticParams(): Promise<
107+
Awaited<PageProps["params"]>[]
108+
> {
104109
const versions = await getVersions();
105110

106111
const returnVal = await Promise.all(
@@ -125,8 +130,7 @@ export function getTDocPage(options: {
125130
}),
126131
);
127132

128-
const paths = returnVal.flat();
129-
return paths.map((p) => Promise.resolve(p));
133+
return returnVal.flat();
130134
}
131135

132136
async function generateMetadata(props: PageProps): Promise<Metadata> {

0 commit comments

Comments
 (0)