Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 22, 13:15 UTC
fix(docs): add custom metadata for reference index page (#2481)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sushmitha Mallesh committed
Jan 27, 2026 at 23:47 UTC
2196fcaea6f5fc64a67cbc9d39e461d4e8239f99
2 files changed
+38
-2
docs/app/(home)/reference/[[...slug]]/page.tsx
+13
@@ -72,6 +72,19 @@ export async function generateMetadata({
72
params: Promise<{ slug?: string[] }>;
73
}): Promise<Metadata> {
74
const { slug } = await params;
75
+
76
+ // Index page - show custom metadata
77
+ if (!slug || slug.length === 0) {
78
+ const ogImage = getOgImageUrl('reference', [], 'API Reference', 'REST API and SDK reference for Composio');
79
+ return {
80
+ title: 'API Reference',
81
+ description: 'REST API and SDK reference for Composio',
82
+ alternates: { canonical: '/reference' },
83
+ openGraph: { images: [ogImage] },
84
+ twitter: { card: 'summary_large_image', images: [ogImage] },
85
+ };
86
+ }
87
+
88
const page = referenceSource.getPage(slug);
89
if (!page) notFound();
90
docs/app/og/reference/[...slug]/route.tsx
+25
-2
@@ -10,7 +10,24 @@ export async function GET(
10
{ params }: { params: Promise<{ slug: string[] }> },
11
) {
12
const { slug } = await params;
13
- const page = referenceSource.getPage(slug.slice(0, -1));
13
+ const pageSlug = slug.slice(0, -1); // Remove 'image.png'
14
+
15
+ // Index page
16
+ if (pageSlug.length === 0) {
17
+ return new ImageResponse(
18
+ <DefaultImage
19
+ title="API Reference"
20
+ description="REST API and SDK reference for Composio"
21
+ site="Composio"
22
+ />,
23
+ {
24
+ width: 1200,
25
+ height: 630,
26
+ },
27
+ );
28
+ }
29
+
30
+ const page = referenceSource.getPage(pageSlug);
31
if (!page) notFound();
32
33
return new ImageResponse(
@@ -27,7 +44,13 @@ export async function GET(
44
}
45
46
export function generateStaticParams() {
30
- return referenceSource.getPages().map((page) => ({
47
+ // Index page
48
+ const indexParam = { slug: ['image.png'] };
49
+
50
+ // All reference pages
51
+ const pageParams = referenceSource.getPages().map((page) => ({
52
slug: [...page.slugs, 'image.png'],
53
}));
54
+
55
+ return [indexParam, ...pageParams];
56
}