From 60244ba5637d889530ae646986b1890c6b89efea Mon Sep 17 00:00:00 2001 From: Chris Villa Date: Tue, 28 Nov 2023 17:51:38 +0000 Subject: [PATCH] fix: use correct title path in recipes --- recipes/next/app/[...puckPath]/page.tsx | 2 +- recipes/remix/app/routes/_index.tsx | 2 +- recipes/remix/app/routes/edit.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/next/app/[...puckPath]/page.tsx b/recipes/next/app/[...puckPath]/page.tsx index b8d9eda04d..72f5edaf60 100644 --- a/recipes/next/app/[...puckPath]/page.tsx +++ b/recipes/next/app/[...puckPath]/page.tsx @@ -23,7 +23,7 @@ export async function generateMetadata({ const path = `/${puckPath.join("/")}`; return { - title: getPage(path)?.root.title, + title: getPage(path)?.root.props.title, }; } diff --git a/recipes/remix/app/routes/_index.tsx b/recipes/remix/app/routes/_index.tsx index 40856cb3ad..c9917fad64 100644 --- a/recipes/remix/app/routes/_index.tsx +++ b/recipes/remix/app/routes/_index.tsx @@ -22,7 +22,7 @@ export const loader = async ({ params }: LoaderFunctionArgs) => { }; export const meta: MetaFunction = ({ data }) => { - const title = data?.puckData?.root?.title || "Page"; + const title = data?.puckData?.root?.props?.title || "Page"; return [{ title }]; }; diff --git a/recipes/remix/app/routes/edit.tsx b/recipes/remix/app/routes/edit.tsx index 9c7c1d4ffb..bc923b245b 100644 --- a/recipes/remix/app/routes/edit.tsx +++ b/recipes/remix/app/routes/edit.tsx @@ -40,7 +40,7 @@ export const loader = async ({ params }: LoaderFunctionArgs) => { }; export const meta: MetaFunction = ({ data }) => { - const title = data?.initialData?.root?.title || "Untitled page"; + const title = data?.initialData?.root?.props?.title || "Untitled page"; return [{ title: `Editing: ${title}` }]; };