diff --git a/app/integrations/[slug]/page.tsx b/app/integrations/[slug]/page.tsx new file mode 100644 index 00000000000..f7fc4ed997d --- /dev/null +++ b/app/integrations/[slug]/page.tsx @@ -0,0 +1,151 @@ +import type { Metadata } from 'next'; +import { notFound } from 'next/navigation'; +import Link from 'next/link'; +import { InlineTOC } from 'fumadocs-ui/components/inline-toc'; +import { integrations } from '@/utils/source'; +import { createMetadata } from '@/utils/metadata'; +import { buttonVariants } from '@/components/ui/button'; +import { ArrowUpRightIcon } from 'lucide-react'; +// import { Control } from '@/app/(home)/blog/[slug]/page.client'; + +interface Param { + slug: string; +} + +export const dynamicParams = false; + +export default function Page({ + params, +}: { + params: Param; +}): React.ReactElement { + const page = integrations.getPage([params.slug]); + + if (!page) notFound(); + + const path = `content/integrations/${page.file.path}`; + + const categories = page.data.category ? page.data.category.split(',').map((category) => category.trim()) : []; + + return ( + <> +
+
+ {page.data.title} +

+ {page.data.title} +

+
+

{page.data.description}

+ + Back + +
+
+
+ +
+
+
+

Developer:

+

{page.data.developer}

+
+
+

Category:

+
+ {categories.map((category) => ( +
+ {category} +
+ ))} +
+
+
+

Website:

+ + {page.data.website} + +
+
+

Documentation:

+ + {page.data.documentation} + +
+ + + + Edit on Github + + + {/* */} +
+
+ + ); +} + +export function generateMetadata({ params }: { params: Param }): Metadata { + const page = integrations.getPage([params.slug]); + + if (!page) notFound(); + + const description = + page.data.description ?? 'Learn how to build on Avalanche blockchain with Academy'; + + const imageParams = new URLSearchParams(); + imageParams.set('title', page.data.title); + imageParams.set('description', description); + + const image = { + alt: 'Banner', + url: `/api/og/guide/${params.slug[0]}?${imageParams.toString()}`, + width: 1200, + height: 630, + }; + + return createMetadata({ + title: page.data.title, + description, + openGraph: { + url: `/docs/${page.slugs.join('/')}`, + images: image, + }, + twitter: { + images: image, + }, + }); +} + + +export function generateStaticParams(): Param[] { + return integrations.getPages().map((page) => ({ + slug: page.slugs[0], + })); +} \ No newline at end of file diff --git a/app/integrations/layout.tsx b/app/integrations/layout.tsx new file mode 100644 index 00000000000..a15489ac1ff --- /dev/null +++ b/app/integrations/layout.tsx @@ -0,0 +1,15 @@ +import { Layout } from 'fumadocs-ui/layout'; +import type { ReactNode } from 'react'; +import { Footer } from '@/components/footer'; +import { baseOptions } from '@/app/layout.config'; + +export default function HomeLayout({ + children, +}: { + children: ReactNode; +}): React.ReactElement { + return + {children} +