diff --git a/app/[page]/page.tsx b/app/[page]/page.tsx index 3dfde9f92..22810ae46 100644 --- a/app/[page]/page.tsx +++ b/app/[page]/page.tsx @@ -1,8 +1,6 @@ import type { Metadata } from 'next'; import Prose from 'components/prose'; -import { getPage } from 'lib/shopify'; -import { notFound } from 'next/navigation'; export const runtime = 'edge'; @@ -13,29 +11,52 @@ export async function generateMetadata({ }: { params: { page: string }; }): Promise { - const page = await getPage(params.page); + // const page = await getPage(params.page); - if (!page) return notFound(); + // if (!page) return notFound(); + if (params) { + } return { - title: page.seo?.title || page.title, - description: page.seo?.description || page.bodySummary, - openGraph: { - publishedTime: page.createdAt, - modifiedTime: page.updatedAt, - type: 'article' - } + title: 'the happy ape', + description: 'joy meets compassion' + // openGraph: { + // publishedTime: page.createdAt, + // modifiedTime: page.updatedAt, + // type: 'article' + // } }; + + // return { + // title: page.seo?.title || page.title, + // description: page.seo?.description || page.bodySummary, + // openGraph: { + // publishedTime: page.createdAt, + // modifiedTime: page.updatedAt, + // type: 'article' + // } + // }; } export default async function Page({ params }: { params: { page: string } }) { - const page = await getPage(params.page); + // const page = await getPage(params.page); - if (!page) return notFound(); + // if (!page) return notFound(); + if (params) { + } return ( <> -

{page.title}

+

the happy ape

+ +

+ {`This document was last updated on ${new Intl.DateTimeFormat(undefined, { + year: 'numeric', + month: 'long', + day: 'numeric' + }).format(new Date())}.`} +

+ {/*

{page.title}

{`This document was last updated on ${new Intl.DateTimeFormat(undefined, { @@ -43,7 +64,7 @@ export default async function Page({ params }: { params: { page: string } }) { month: 'long', day: 'numeric' }).format(new Date(page.updatedAt))}.`} -

+

*/} ); } diff --git a/app/sitemap.ts b/app/sitemap.ts index fe8ed96ac..a5f91557c 100644 --- a/app/sitemap.ts +++ b/app/sitemap.ts @@ -1,4 +1,4 @@ -import { getCollections, getPages, getProducts } from 'lib/shopify'; +// import { getCollections, getPages, getProducts } from 'lib/shopify'; import { validateEnvironmentVariables } from 'lib/utils'; import { MetadataRoute } from 'next'; @@ -19,34 +19,34 @@ export default async function sitemap(): Promise { lastModified: new Date().toISOString() })); - const collectionsPromise = getCollections().then((collections) => - collections.map((collection) => ({ - url: `${baseUrl}${collection.path}`, - lastModified: collection.updatedAt - })) - ); + // const collectionsPromise = getCollections().then((collections) => + // collections.map((collection) => ({ + // url: `${baseUrl}${collection.path}`, + // lastModified: collection.updatedAt + // })) + // ); - const productsPromise = getProducts({}).then((products) => - products.map((product) => ({ - url: `${baseUrl}/product/${product.handle}`, - lastModified: product.updatedAt - })) - ); + // const productsPromise = getProducts({}).then((products) => + // products.map((product) => ({ + // url: `${baseUrl}/product/${product.handle}`, + // lastModified: product.updatedAt + // })) + // ); - const pagesPromise = getPages().then((pages) => - pages.map((page) => ({ - url: `${baseUrl}/${page.handle}`, - lastModified: page.updatedAt - })) - ); + // const pagesPromise = getPages().then((pages) => + // pages.map((page) => ({ + // url: `${baseUrl}/${page.handle}`, + // lastModified: page.updatedAt + // })) + // ); - let fetchedRoutes: Route[] = []; + const fetchedRoutes: Route[] = []; - try { - fetchedRoutes = (await Promise.all([collectionsPromise, productsPromise, pagesPromise])).flat(); - } catch (error) { - throw JSON.stringify(error, null, 2); - } + // try { + // fetchedRoutes = (await Promise.all([collectionsPromise, productsPromise, pagesPromise])).flat(); + // } catch (error) { + // throw JSON.stringify(error, null, 2); + // } return [...routesMap, ...fetchedRoutes]; } diff --git a/next.config.js b/next.config.js index 8bab35c40..f8124fd43 100644 --- a/next.config.js +++ b/next.config.js @@ -14,6 +14,9 @@ module.exports = { } ] }, + experimental: { + missingSuspenseWithCSRBailout: false + }, async redirects() { return [ {