Skip to content

Commit c02104d

Browse files
committed
[Portal] Fix reference page static generation (#5484)
NOTE: This will not build - Recently the sidebar categories have been updated in the reference pages and this is creating issues with static build. Need to fix those errors <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on making adjustments to various files, including changing limits on data retrieval, modifying the structure of TypeScript types, and cleaning up the formatting of documentation. ### Detailed summary - Changed `-limit` from `50` to `20` in `apps/portal/src/app/changelog/ghost.ts`. - Removed `classes`, `variables`, `types`, and `enums` from `subgroups` in `apps/portal/src/app/references/components/TDoc/utils/subgroups.ts`. - Cleaned up documentation text in `apps/portal/src/app/typescript/v5/chain/page.mdx`. - Reformatted `PageProps` type definition in `apps/portal/src/app/references/components/TDoc/PageLayout.tsx` for better readability. - Updated return type of `generateStaticParams` function to be more explicit in `apps/portal/src/app/references/components/TDoc/PageLayout.tsx`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent c0ab87d commit c02104d

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

apps/portal/src/app/changelog/ghost.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export async function fetchChangeLogs() {
88
key: GHOST_THIRDWEB_BLOG_KEY,
99
fields: ["title", "slug", "published_at"].join(","),
1010
filter: "tag:changelog",
11-
limit: "50",
11+
limit: "20",
1212
order: "published_at DESC",
1313
include: ["authors", "tags"].join(","),
1414
})

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> {

apps/portal/src/app/references/components/TDoc/utils/subgroups.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
export const subgroups = {
22
components: "UI Components",
33
hooks: "React Hooks",
4-
classes: "Classes",
54
functions: "Core Functions",
6-
variables: "Variables",
7-
types: "Types",
8-
enums: "Enums",
95
};
106

117
export const nameToSubgroupSlug = (() => {

apps/portal/src/app/typescript/v5/chain/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { defineChain } from "thirdweb";
1010
const myChain = defineChain(myChainId);
1111
```
1212

13-
The SDK comes with predefined [popular chains](/references/typescript/v5/variables) like `base`, `polygon`, and more exported from the `thirdweb/chains` entrypoint.
13+
The SDK comes with predefined popular chains like `base`, `polygon`, and more exported from the `thirdweb/chains` entrypoint.
1414

1515
```ts
1616
import { polygon } from "thirdweb/chains";

0 commit comments

Comments
 (0)