Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

export metadata since we client render challenges

bautistaaa5db207fd468c
diff --git a/apps/web/src/app/challenge/[id]/page.tsx b/apps/web/src/app/challenge/[id]/page.tsx
index 4c03feba..f7441764 100644
--- a/apps/web/src/app/challenge/[id]/page.tsx
+++ b/apps/web/src/app/challenge/[id]/page.tsx
@@ -10,6 +10,13 @@ interface Props {
};
}
+export async function generateMetadata({ params: { id } }: Props) {
+ const challenge = await getChallengeRouteData(id, null);
+ return {
+ title: challenge.name,
+ description: challenge.shortDescription,
+ };
+}
export default async function Challenges({ params: { id } }: Props) {
const session = await getServerAuthSession();
const challenge = await getChallengeRouteData(id, session);