diff --git a/src/app/(website)/cmyk/layout.tsx b/src/app/(website)/cmyk/layout.tsx new file mode 100644 index 00000000..9ac9bc5a --- /dev/null +++ b/src/app/(website)/cmyk/layout.tsx @@ -0,0 +1,27 @@ +import SectionHero from '@/components/SectionHero'; +import { getPageByName } from '@/lib/api.server'; + +export default async function CMYKLayout({ + children, +}: { + children: React.ReactNode; +}) { + const page = await getPageByName({ + name: 'CMYK', + next: { + revalidate: 60, + }, + }); + + return ( +
+ + + {children} +
+ ); +} diff --git a/src/app/(website)/cmyk/page.tsx b/src/app/(website)/cmyk/page.tsx new file mode 100644 index 00000000..916f455d --- /dev/null +++ b/src/app/(website)/cmyk/page.tsx @@ -0,0 +1,35 @@ +import CMYKEdition from '@/components/CMYKEditions'; +import CMYKEditionsSkeleton from '@/components/CMYKEditions/CMYKEditionsSkeleton'; +import { cmykVersions } from '@/components/CMYKEditions/cmykVersions'; +import { getAllCMYKVersionsOrderedFromLatest } from '@/lib/api.server'; +import { getPageMetadata } from '@/lib/seo'; +import type { AppPage } from '@/lib/types'; +import { notFound } from 'next/navigation'; +import { Suspense } from 'react'; + +export const generateMetadata = () => { + return getPageMetadata('CMYK'); +}; + +const CMYKPage: AppPage = async () => { + const versions = await getAllCMYKVersionsOrderedFromLatest({ + next: { revalidate: 3600 }, + }); + + const current = cmykVersions.find( + (cmykVersion) => cmykVersion.version === versions[0], + ); + + if (!current) { + console.warn(`No current CMYK version found for ${versions[0]}`); + notFound(); + } + + return ( + }> + + + ); +}; + +export default CMYKPage;